The popular open-source contract for web professionals by Stuff & Nonsense
- Originally published: 23rd December 2008
- Revised date: March 15th 2016
- Original post
""" | |
Very tiny blockchain implementation -- for learning purpose | |
""" | |
import hashlib | |
import datetime | |
__author__ = "ibrahim@sikilabs.com" | |
__reference__ = "https://medium.com/crypto-currently/lets-build-the-tiniest-blockchain-e70965a248b" |
import paramiko | |
from scp import SCPClient | |
__author__ = "ibrahim@sikilabs.com" | |
""" | |
Example script: file scp | |
requirements: | |
- paramiko==2.2.1 | |
- scp==0.10.2 |
#!/usr/bin/python | |
# Use this script to update a DNS override using the webfaction API | |
# be sure to set your username, password, dns override, and ethenet interface. | |
# Then add a crontab entry for the script, I use every 5 minutes | |
# */5 * * * * /path/to/ddns.py | |
# This is safe as the script exit(0)'s if the ip is the same as wehat is recorded in the file. | |
# Webfaction documentation on DNS overrides | |
# http://docs.webfaction.com/user-guide/domains.html#overriding-dns-records-with-the-control-panel |
__author__ = "Ibrahim Diop <http://ibrahim.zinaria.com>" | |
import sh # http://amoffat.github.io/sh/ | |
import os | |
import ntpath | |
def smart_extract(dirname): | |
""" | |
extract all zip file contained in specified directory |
""" | |
python useful stuff | |
""" | |
def mutual_ex(a, b): | |
""" | |
return a list of element only in a or b | |
""" | |
return [i for i in a if i not in b] + [j for j in b if j not in a] |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
A class that uses different static function depending of a parameter passed in | |
init. Note the use of a single dictionnary instead of multiple conditions | |
""" | |
__author__ = "Ibrahim Diop <http://ibrahim.zinaria.com>" | |
__gist__ = "<https://gist.github.com/diopib/7679559>" |
""" Generate lovely ideas for hack day talks """ | |
import random | |
import re | |
productions = { | |
'tech': [ | |
'HTML5', | |
'Audio', | |
'CoffeeScript', |
def df_traversal(d): | |
""" | |
depth-first traversal for dict d | |
pre-order method | |
ref: http://en.wikipedia.org/wiki/Tree_traversal | |
ref: http://en.wikipedia.org/wiki/Depth-first_search | |
""" | |
for key in d: | |
print key |