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
<!-- AddThis Button BEGIN --> | |
<div class="addthis_default_style addthis_32x32_style"> | |
<a class="addthis_button_favorites" style="text-decoration:none;font-size:32px;"> bookmark this page</a> | |
</div> | |
<script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script> | |
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js"></script> | |
<!-- AddThis Button END --> |
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 fabric.api import cd, sudo, run, put | |
def www(domain): | |
''' | |
Create new www file directory | |
''' | |
with cd("/var/www/"): | |
run("mkdir " + domain) | |
sudo('chown -R www-data:www-data ' + domain) |
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
""" | |
In the terminal, go to the directory of the files you want to rename | |
Open yer python CLI, import os, then one-liner. I guess technically 2-liner | |
""" | |
import os | |
[os.rename(f, f.replace('_','-')) for f in os.listdir('.')] |
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
return {"category": category, | |
"category_url": category_url, | |
"winner": winner, | |
"runners_up": runners_up} |
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 StringIO import StringIO | |
import requests | |
from xmlutils.xml2csv import xml2csv | |
"""Grab xml schedules from gsl.tandemcal.com and convert to csv""" | |
varsity_sports_ids = { | |
"boys_baseball": 26, | |
"boys_basketball": 19, | |
"girls_basketball": 20, | |
"boys_cross_country": 7, |
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
import sys | |
from django.conf import settings | |
from django.core.cache import cache | |
from twython import Twython, TwythonError | |
from ttp.ttp import Parser | |
from pprint import pprint | |
def parse_tweet(x): | |
""" |
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
<script type='text/javascript'> | |
googletag.cmd.push(function() { Modernizr.mq('(min-width: 1200px)') && googletag.display('div-gpt-ad-1377815593640-3') }); | |
</script> |
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
<!DOCTYPE html> | |
<html><head data-gwd-animation-mode="quickMode"> | |
<meta name="generator" content="Google Web Designer 1.0.0.924"> | |
<meta name="template" content="Banner 1.0.5"> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<style type="text/css">html, body { | |
width: 100%; | |
height: 100%; | |
margin: 0px; |
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
import argparse |
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
'''Hide a zipfile in an image or unpack an image with a hidden archive in it''' | |
import argparse | |
from zipfile import ZipFile | |
def hide(image_file, archive_file): | |
'''Append an archive onto the end of an image''' | |
# open the image file in "append binary" mode |