Skip to content

Instantly share code, notes, and snippets.

@zarino
zarino / jquery.zoompan.js
Created February 28, 2012 12:06
ZoomPan jQuery Plugin (for ScraperWiki)
// Invoke using something like:
// HTML: <img src="foobar.png" width="400" height="300" alt="Example" />
// JQUERY: $('img').zoompan({sw: 400, sh: 300, lw: 2851, lh: 2135});
(function($){
$.fn.zoompan = function(settings) {
settings = jQuery.extend({
sw: 100, // small image width
sh: 100, // small image height
@zarino
zarino / gist:5083617
Last active December 14, 2015 11:59 — forked from beauvais/gist:5083596
//jsonData contains data in the appropriate format
var json_table = new google.visualization.Table(document.getElementById('table_div_json'))
var json_data = new google.visualization.DataTable(jsonData, 0.6);
json_table.draw(json_data, {
showRowNumber: true
});
@zarino
zarino / love.py
Created April 16, 2013 20:04
Another love forecasting app from #PyPool
#!/usr/bin/env python
# By David, Jonathan, David, and Zarino
import sys
names = sys.argv
score = 0.0
p1 = names[1].lower()
[user]
name = Your Name Here
email = your@email.com
[github]
user = your_github_username
token = your_github_api_key
[core]
editor = nano
pager =
[color]
#!/bin/sh
# Optware setup
[ -x /etc/rc.optware ] && /etc/rc.optware start
#! /bin/sh
if test -z "${REAL_OPT_DIR}"; then
# next line to be replaced according to OPTWARE_TARGET
REAL_OPT_DIR=/volume1/@optware
fi
case "$1" in
start)
echo "Starting Optware."
~/mysociety/popit:zarinozappia ⌘ npm rebuild
> bcrypt@0.7.5 install /Users/zarinozappia/Work/mySociety/popit/node_modules/bcrypt
> node-gyp rebuild
CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
SOLINK_MODULE(target) Release/bcrypt_lib.node
SOLINK_MODULE(target) Release/bcrypt_lib.node: Finished
~/Work/mySociety/popit:zarinozappia ⌘ make test
compass clean
remove .sass-cache/
remove public/css/docs.css
remove public/css/foundicons/general_foundicons.css
remove public/css/foundicons/general_foundicons_ie7.css
remove public/css/ie.css
remove public/css/popit.css
remove public/css/print.css
rm -rf public/css
~/Work/mysociety/sayit.mysociety.org:zarinozappia ⌘ git ls-files -v
H .gitignore
H .tx/config
H LICENSE.txt
H README.md
H about/__init__.py
H about/models.py
H about/templates/about/charles-taylor/index.html
H about/templates/about/leveson/index.html
H about/templates/about/shakespeare/index.html
@zarino
zarino / gist:c597d442560a513ea9cf
Last active August 29, 2015 14:06
Convert GNU Mailman output to tab-separated file for MailChimp
#!/usr/bin/env python
# Assumes a file called mailman.txt in the working directory,
# generated by: `list_members -p -f -n enabled -o ~/mailman.txt news`
import csv
import re
with open('exported.tsv', 'wb') as csvfile:
csvwriter = csv.writer(csvfile, delimiter="\t")