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 February 21, 2024 18:20
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 May 10, 2024 12:04
Simply encrypt and decrypt Strings in Ruby.
require 'openssl'
class String
def encrypt(key)
cipher = OpenSSL::Cipher.new('DES-EDE3-CBC').encrypt
cipher.key = Digest::SHA1.hexdigest key
s = cipher.update(self) + cipher.final
s.unpack('H*')[0].upcase
end
@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)