This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am fmartingr on github. | |
* I am fmartingr (https://keybase.io/fmartingr) on keybase. | |
* I have a public key whose fingerprint is CDCC 52FA FE1A 5CC4 6809 E76E 7975 4701 665A 55CB | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import smtplib | |
gmail_user = "your_email@gmail.com" | |
gmail_pwd = "your_password" | |
msg['From'] = gmail_user | |
msg['To'] = to |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pip install codebase-api fabric | |
from codebase import CodebaseClient | |
from fabric.operations import local | |
CLIENT_ID = 'foo/bar' | |
CLIENT_KEY = 'key' | |
client = CodebaseClient(CLIENT_ID, CLIENT_KEY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"model": "auth.user", | |
"pk": 1, | |
"fields": { | |
"first_name": "John", | |
"last_name": "Doe", | |
"username": "admin", | |
"email": "email@mydevsite.com", | |
"password": "pbkdf2_sha256$10000$VVJjeNI4DX0Z$dI0w6zSkvvFO+B7s9+rxVS0sj6N2Tp/xVny3FokWQis=", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def pid_exists(pid): | |
"""Check whether pid exists in the current process table.""" | |
if pid < 0: | |
return False | |
try: | |
os.kill(pid, 0) | |
except OSError, e: | |
return e.errno == errno.EPERM | |
else: | |
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "date" | |
# Configuration | |
base_dir = Dir.pwd | |
blog_dir = "#{base_dir}/blog" | |
source_dir = "#{blog_dir}/source" | |
posts_dir = "#{source_dir}/_posts" | |
git_remote = "origin" | |
git_branch = "master" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
$data = "Hash cheching!"; | |
echo '<pre>'; | |
printf("%-12s %6s %11s %s\n", "Hash name", "Lenght", "Time", "Hash"); | |
foreach (hash_algos() as $hash_type) { | |
$start = microtime(true); | |
$hash = hash($hash_type, $data, false); | |
$end = microtime(true); | |
$elapsed = number_format($end - $start, 6); | |
printf("%-12s %6d %10fs %s\n", $hash_type, strlen($hash), $elapsed, $hash); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Imports | |
import dataset | |
### | |
# CONFIG | |
### | |
DATABASE_URL = 'sqlite:///' # In memory database | |
### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Orignal version taken from http://www.djangosnippets.org/snippets/186/ | |
# Original author: udfalkso | |
# Modified by: Shwagroo Team and Gun.io | |
import sys | |
import os | |
import re | |
import hotshot, hotshot.stats | |
import tempfile | |
import StringIO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Form | |
### | |
Class to manage dynamic forms with javascript | |
> var form = Form('/destiny/path/', {'username':'fmartingr'}) | |
> form.addField('password', 'aw8cnwn8t7x9my898wyf9mw67n') | |
> form.submit() | |
### | |
constructor: (action, params={}, method='post') -> |
OlderNewer