Skip to content

Instantly share code, notes, and snippets.

@jpadilla
jpadilla / demo.js
Last active August 29, 2015 14:00 — forked from gcollazo/demo.js
var previews = new FilePreviews({debug: true, loaderImage: 'http://placehold.it/100x100'});
var url = 'https://www.filepicker.io/api/file/WHOGzEmPRSGNYKyHRBWk';
var options = {
size: {
width: 100,
height: 999,
},
metadata: ['ocr', 'exif']
};
1033edge.com
11mail.com
123.com
123box.net
123india.com
123mail.cl
123qwe.co.uk
150ml.com
15meg4free.com
163.com
@jpadilla
jpadilla / qurl.py
Created July 25, 2013 16:40 — forked from pricco/qurl.py
"""
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
# encoding=utf-8
import sys
import datetime
import email
import mimetypes
import os
import time
import gzip
import subprocess
"""
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
"""
@jpadilla
jpadilla / cee_rob1.py
Created November 13, 2012 11:19
7 lines, no external requirements (7 lines, 28 words, 605 chars)
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)
@jpadilla
jpadilla / json-response.py
Created October 6, 2011 17:57 — forked from leah/json-response.py
JSONResponse classes
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
@jpadilla
jpadilla / gist:1175941
Created August 27, 2011 22:24 — forked from saikat/gist:1084146
Stripe sample checkout form
<!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">
#!/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
#!/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