Skip to content

Instantly share code, notes, and snippets.

View tacitphoenix's full-sized avatar

Samson Ondiek tacitphoenix

View GitHub Profile
import asyncio
loop = asyncio.get_event_loop()
async def hello():
await asyncio.sleep(3)
print('Hello!')
if __name__ == '__main__':
loop.run_until_complete(hello())
@rachelhyman
rachelhyman / gist:b1f109155c9dafffe618
Last active January 3, 2025 00:12
Github README anchor links

To create anchor links that jump down to different sections of a README (as in an interactive table of contents), first create a heading:
#Real Cool Heading

The anchor link for that heading is the lowercase heading name with dashes where there are spaces. You can always get the anchor name by visiting the README on Github.com and clicking on the anchor that appears when you hover to the left of the heading. Copy everything starting at the #:
#real-cool-heading

Wherever you want to link to your Real Cool Heading section, put your desired text in brackets, followed by the anchor link in parentheses:
[Go to Real Cool Heading section](#real-cool-heading)

@wteuber
wteuber / encrypt_decrypt.rb
Last active February 2, 2026 15:13
Basic encrypt and decrypt Strings in Ruby with deterministic salt or IV, generate and store random salt and IV in production
require 'openssl'
class String
CIPHER_NAME = 'aes-256-cbc'.freeze
PBKDF_ITER = 200_000
KEY_LEN = 32 # 256 bits
SALT_CONST = "fixed-global-salt-v1".freeze
IV_SALT_CONST = "fixed-iv-salt-v1".freeze
def encrypt(password)
@tacitphoenix
tacitphoenix / Mac Bottle Quickstart
Created September 29, 2011 01:47
Quick, Fun and Painless way to setup Bottle on a Mac. Enjoy the minimalistic Python Micro Framework goodness!
Bottle -> The minimalistic Python Mirco Framework
Prequisites:
1) Python 2.7 (This comes with the mac)
2) pip - python package manager (replacement for easy_install) think gems for Ruby
3) virtualenv - manage dependencies created by having multiple projects think rvm for Ruby
4) Bottle Module
Setup
- python -V (check python version should be 2.7.x)