Skip to content

Instantly share code, notes, and snippets.

@andymcgrath
andymcgrath / starwars-universe.txt
Created October 25, 2012 03:34
Star Wars Universe Graph [use with Neo4j http://console.neo4j.org/?id=StarWars]
START LUKE=node(0)
CREATE
(HAN {name:"Han Solo"}),
(LEIA {name:"Princess Leia Organa"}),
(OBI_WAN {name:"Obi Wan Kenobi"}),
(YODA {name : "Yoda"}),
(TARKIN {name:"Grand Moff Tarkin"}),
(VADER {name:"Darth Vader"}),
(C3PO {name:"C3PO", droid:true}),
@catupper
catupper / dictionary.txt
Created September 20, 2012 11:22
wordhere solver dictionary
This file has been truncated, but you can view the full file.
aaa
aachen
aah
aahed
aahing
aahs
aal
aalborg
aalii
aaliis
@paulirish
paulirish / rAF.js
Last active June 24, 2025 18:39
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
#!/usr/bin/python
from sorl.thumbnail.conf import settings
from sorl.thumbnail.base import ThumbnailBackend
FORMAT_DICT = {
'png': 'PNG',
'jpeg': 'JPEG',
'jpg': 'JPEG',
@dbrgn
dbrgn / queryset_generators.py
Created April 1, 2011 08:41
queryset_generator and queryset_list_generator
def queryset_generator(queryset, chunksize=1000):
"""
Iterate over a Django Queryset ordered by the primary key
This method loads a maximum of chunksize (default: 1000) rows in its
memory at the same time while django normally would load all rows in its
memory. Using the iterator() method only causes it to not preload all the
classes.
Note that the implementation of the generator does not support ordered query sets.
@renyi
renyi / gist:829149
Created February 16, 2011 10:23
CSS snippets
h1 {text-decoration:overline}
h2 {text-decoration:line-through}
h3 {text-decoration:underline}
h4 {text-decoration:blink}
background:red url(image.png) repeat top left scroll;
font:bold 1em/1.2em georgia,"times new roman",serif;
border:5px solid red;
@renyi
renyi / gist:829071
Created February 16, 2011 09:06
CSS3 - snippets
/* Gradient */
background-image: -moz-linear-gradient( center bottom,
rgb(22,21,18) 22%,
rgb(49,49,45) 61%,
rgb(79,79,72) 81% );
background-image: -webkit-gradient( linear,
left bottom,
left top,
color-stop(0.22, rgb(22,21,18)),
@renyi
renyi / gist:829068
Created February 16, 2011 09:02
jquery - snippets
function get_ajax(link, para) {
$.get(link, { para }, function(data) {
$('#ajax-data').html(data);
});
}
$(document).ready(function() {
// Datepicker
$("#date_picker").datepicker({dateFormat: 'yy/mm/dd'});
@tkersey
tkersey / Undo a commit and redo
Created October 8, 2010 22:36
Git: undo a commit and redo
http://stackoverflow.com/questions/927358/git-undo-last-commit
Undo a commit and redo
$ git commit ...
$ git reset --soft HEAD^ (1)
$ edit (2)
$ git commit -a -c ORIG_HEAD (3)
This is most often done when you remembered what you just committed is incomplete, or you misspelled your commit message, or both. Leaves working tree as it was before "reset".
<!DOCTYPE html>
<!-- Helpful things to keep in your <head/>
// Brian Blakely, 360i
// http://twitter.com/brianblakely/
-->
<head>
<!-- Disable automatic DNS prefetching.