Skip to content

Instantly share code, notes, and snippets.

@samsalisbury
samsalisbury / django-crate.sh
Last active December 16, 2015 14:19
Create new django project including south, psychopg2, django-facebook
# Django settings for hidjango project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
@samsalisbury
samsalisbury / .gitconfig
Last active June 22, 2022 19:30
Git diff and merge with p4merge (OSX)
[merge]
keepBackup = false
tool = p4merge
[mergetool "p4merge"]
cmd = /Applications/p4merge.app/Contents/Resources/launchp4merge "\"$PWD/$BASE\"" "\"$PWD/$REMOTE\"" "\"$PWD/$LOCAL\"" "\"$PWD/$MERGED\""
keepTemporaries = false
trustExitCode = false
keepBackup = false
[diff]
tool = p4merge
@samsalisbury
samsalisbury / monadicTimeout.js
Created June 13, 2012 16:31
JavaScript monadic timeout (jQuery plugin)
// Provides safe way to ensure that you only have a single timeout
// set for a particular event, in the face of browsers not always
// firing the expected events...
// Usage example:
//
// var myTimeout = $.monadicTimeout(function() { doSomething(); }, 500);
//
// $(".some-class").mouseenter(myTimeout.clear);
// $(".some-class").mouseleave(myTimeout.set);
@samsalisbury
samsalisbury / linear-gradient.less
Created November 4, 2011 17:03
dotLess CSS gradient mixin...
/*
Based on output from http://www.colorzilla.com/gradient-editor/
*/
.linear-gradient(@r1, @g1, @b1, @a1, @p1, @r2, @g2, @b2, @a2, @p2, @r3, @g3, @b3, @a3, @p3, @r4, @g4, @b4, @a4, @p4) {
background: rgb(@r1,@g1,@b1);
background: -moz-linear-gradient(top,
rgba(@r1,@g1,@b1,@a1) @p1,
REM Start the RepositoryHosting.com backup download script
C:
"\Program Files (x86)\Git\bin\sh.exe" -login -c /c/Users/Sam/backup.sh
@samsalisbury
samsalisbury / repositoryhosting-download-template.sh
Created April 24, 2011 12:57
RepositoryHosting.com backup download script
#!/bin/sh
# RepositoryHosting.com backup download script
#
# This script downloads your daily RepositoryHosting.com backups.
##################################################################
##
### Configuration
##