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
// Scraping Made Easy with jQuery and SelectorGadget | |
// (http://blog.dtrejo.com/scraping-made-easy-with-jquery-and-selectorga) | |
// by David Trejo | |
// | |
// Install node.js and npm: | |
// http://joyeur.com/2010/12/10/installing-node-and-npm/ | |
// Then run | |
// npm install jsdom jquery http-agent | |
// node numresults.js | |
// |
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
#!/bin/bash | |
# To run do: curl https://theurl.com/bootstrap.sh | bash && source ~/.profile | |
# | |
# Based on Amazon EC2 AMI ID ami-ccf405a5 Ubuntu Server 10.10 | |
# This script must install the following requirements | |
# * apache2 | |
# * mod_wsgi | |
# * mysql | |
# * pip |
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
#!/bin/bash | |
# To run do: | |
# wget http://url.com/bootstrap.sh && chmod +x bootstrap.sh && ./bootstrap.sh && source ~/.profile | |
# | |
# Based on Amazon EC2 AMI ID ami-ccf405a5 Ubuntu Server 10.10 | |
# This script will: | |
# * install/config apache2 | |
# * install mod_wsgi | |
# * install/config nginx |
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
#!/bin/bash | |
# To run do: | |
# wget https://gist.github.com/raw/850359/ea02e22f021b7ebf2f602811461677ab4a3f2a9e/bootstrap.sh && chmod +x bootstrap.sh && ./bootstrap.sh && source ~/.profile | |
# | |
# Based on Amazon EC2 AMI ID ami-ccf405a5 Ubuntu Server 10.10 | |
# This script will: | |
# * install/config apache2 | |
# * install mod_wsgi | |
# * install/config nginx |
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 lang="en"> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> | |
<title>Stripe Sample Form</title> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> | |
<script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.8.1/jquery.validate.min.js"></script> | |
<script type="text/javascript" src="https://js.stripe.com/v1/"></script> | |
<script type="text/javascript"> |
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 re | |
import simplejson | |
from django.http import HttpResponse | |
from django.conf import settings | |
class JSONResponse(HttpResponse): | |
def __init__(self, request, data): | |
indent = 2 if settings.DEBUG else None |
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 urllib2 | |
import lxml.etree as E | |
import time | |
print '\nGOVERNOR\nISLAND WIDE RESULTS\n' | |
while 1: | |
print '\n'.join(['%s\n'%E.fromstring(urllib2.urlopen('http://is.gd/wB6SJq').read()).find('date').text,'\n'.join(map(lambda e:'%s (%s) => %s (%s%%)'%e,[(o.find('name/es').text,o.find('pe/es').text,format(int(o.find('votes').text),',d'),str(float(o.find('votes').text)/sum([int(e.text)for e in E.fromstring(urllib2.urlopen('http://is.gd/wB6SJq').read()).findall('option/votes')])*100)[0:5])for o in E.fromstring(urllib2.urlopen('http://is.gd/wB6SJq').read()).findall('option')]))]) | |
time.sleep(120) |
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
""" | |
A simple script to copy a Basecamp classic todo list | |
over to Blimp as a goal with tasks | |
@author: Dave Jeffery | |
@requirements: | |
pip install git+git://github.com/nowherefarm/basecamp.git | |
pip install blimp | |
""" |
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
# encoding=utf-8 | |
import sys | |
import datetime | |
import email | |
import mimetypes | |
import os | |
import time | |
import gzip | |
import subprocess |
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
""" | |
qurl is a tag to append, remove or replace query string parameters from an url | |
https://gist.github.com/pricco/3714115 | |
""" | |
import re | |
from django.template import Library, Node, TemplateSyntaxError | |
from urlparse import urlparse, parse_qsl, urlunparse | |
from django.utils.encoding import smart_str | |
from urllib import urlencode |
OlderNewer