Skip to content

Instantly share code, notes, and snippets.

@jodytate
jodytate / shuffle trello cards
Last active August 29, 2015 14:22
shuffle trello
$('div.list div.list-card').sort(function(){
return Math.random()*10 > 5 ? 1 : -1;
}).each(function(){
var $t = $(this),
color = $t.attr('class');
$t.css({backgroundColor: color}).appendTo( $t.parent() );
});
var setTextMeasure = function (contentElement, targetMeasure, maxSize, minSize) {
if (!contentElement) contentElement = document.createElement('p');
if (!targetMeasure) targetMeasure = 66;
if (!maxSize) maxSize = 16;
if (!minSize) minSize = 9;
var sizer = contentElement.cloneNode();
sizer.style.cssText = 'margin: 0; padding: 0; color: transparent; background-color: transparent; position: absolute;';
@fling
fling / gist:956189
Created May 4, 2011 22:32
page control css
#pagewrapper {
position:absolute;
z-index:1;
top: 15px; bottom:0;
width:724px;
overflow:hidden;
height: 974px;
}
#pageflip {
@hayespotter
hayespotter / webkitten.sh
Created August 17, 2011 15:04 — forked from tomhodgins/webkitten.sh
Update WebKit to latest nightly build for OS X
#! /bin/sh
echo "Welcome to WebKitten, the WebKit updater"
echo "This process may take a few minutes"
mkdir ~/.webkitten
cd ~/.webkitten
# This sets a variable named 'LATEST' that is the
# value of the latest webkit download for OS X
LATEST=`curl -s "http://nightly.webkit.org" | sed -n 's/.*http/http/'p | sed -n 's/dmg.*/dmg/'p | sed -n 1p`
@NZKoz
NZKoz / aa_instructions.md
Created May 2, 2012 03:07
Back Up All Your Gmail
  • Install getmail (aptitude install getmail4)
  • Set Up Your Imap Server (tl;dr)
  • getmail
  • ruby date_based_archive.rb ~/Maildir/.Archive
@mlgill
mlgill / dropboxsetup.py
Created January 8, 2014 02:57
dropboxsetup: iOS (Pythonista), attempts to handle Dropbox auth token creation and login seamlessly
import dropbox, os, webbrowser
# A generic Dropbox module to create a token and login.
# Michelle L. Gill, 2014/01/06
# To use:
# import dropboxsetup
# sess, client = dropboxsetup.init(TOKEN_FILENAME, APP_KEY, APP_SECRET)
# TOKEN_DIRECTORY can be set to store tokens in a folder, set to "Tokens" by default
@justinlittman
justinlittman / gist:f96230ab58588b6d164f
Last active February 16, 2017 18:56
Sample code for using SPARQL update to load VIVO.
from __future__ import division
from SPARQLWrapper import SPARQLWrapper
import socket
import codecs
import os
import time
from namespace import ns_manager
from rdflib import Graph
import math
"""
An example of minimum requirements to make MultiValueField-MultiWidget for Django forms.
"""
import pickle
from django.http import HttpResponse
from django import forms
from django.template import Context, Template
from django.views.decorators.csrf import csrf_exempt
@lawlesst
lawlesst / vivordfalchemy.py
Last active June 29, 2017 19:05
Reading and writing RDF for VIVO using RDFAlchemy.
import csv
from pprint import pprint
import urllib
from rdflib import Namespace
from rdfalchemy import rdfSingle
from rdfalchemy.rdfSubject import rdfSubject
from rdflib import Literal, BNode, Namespace, URIRef
from rdflib import RDF, RDFS, Graph, OWL
@hellosteadman
hellosteadman / twopy.py
Created March 4, 2014 09:59
Add your Twitter friends' RSS feeds to a single OPML file
"""
This script requires the following Packages
1: Twitter: https://pypi.python.org/pypi/twitter
2: PyQuery: https://pypi.python.org/pypi/pyquery
3: Jinja2: https://pypi.python.org/pypi/Jinja2
It's fairly primitive but works. It uses a Jinja2 template to create an OPML
file from the RSS feeds of the websites run by the people you follow on
Twitter.