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 protected]", | |
"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
from sys import stdout | |
class Colors: | |
HEADER = '\033[95m' | |
BLUE = '\033[94m' | |
GREEN = '\033[92m' | |
YELLOW = '\033[93m' | |
RED = '\033[91m' | |
END = '\033[0m' |
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') -> |
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 fix_contentype_pages(): | |
""" | |
Fix admin recent history name value for django-cms pages | |
""" | |
from django.contrib.contenttypes.models import ContentType | |
items = ContentType.objects.filter(model='page', name='', app_label='cms') | |
for item in items: | |
item.name = 'page' | |
item.save() |
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: |
OlderNewer