This file contains hidden or 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 = "[email protected]" | |
gmail_pwd = "your_password" | |
msg['From'] = gmail_user | |
msg['To'] = to |
This file contains hidden or 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/env python | |
import requests | |
from xml.etree import ElementTree | |
url = 'http://s122-es.ogame.gameforge.com/api/universe.xml' | |
response = requests.get(url) | |
universe = ElementTree.fromstring(response.content) |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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' |