Skip to content

Instantly share code, notes, and snippets.

View eculver's full-sized avatar
🧠
Braining

Evan Culver eculver

🧠
Braining
View GitHub Profile
@eculver
eculver / APPNAME
Created July 5, 2011 17:35 — forked from shimondoodkin/APPNAME
init.d script for node.js for debian
#! /bin/sh
# ------------------------------------------------------------------------------
# SOME INFOS : fairly standard (debian) init script.
# Note that node doesn't create a PID file (hence --make-pidfile)
# has to be run in the background (hence --background)
# and NOT as root (hence --chuid)
#
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts
# INSTALL/REMOVE http://www.debian-administration.org/articles/28
@eculver
eculver / _more.scss
Created June 9, 2011 18:28 — forked from idan/_more.scss
More is Less
$less-column-width: 68px;
$less-gutter-width: 24px;
@function column-width($columns) {
@return ($less-column-width * $columns) + ($less-gutter-width * ($columns - 1));
}
@function grid-padding-px($columns) {
@if $columns == 10 {
@return 48px;
@eculver
eculver / bootstrap.sh
Created June 2, 2011 23:48 — forked from anonymous/bootstrap.sh
Django on Heroku with Celery and Sentry
virtualenv --no-site-packages .
source bin/activate
bin/pip install Django psycopg2 django-sentry
bin/pip freeze > requirements.txt
bin/django-admin.py startproject mysite
cat >.gitignore <<EOF
bin/
include/
lib/
EOF
inoremap <silent> <Bar> <Bar><Esc>:call <SID>align()<CR>a
function! s:align()
let p = '^\s*|\s.*\s|\s*$'
if exists(':Tabularize') && getline('.') =~# '^\s*|' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p)
let column = strlen(substitute(getline('.')[0:col('.')],'[^|]','','g'))
let position = strlen(matchstr(getline('.')[0:col('.')],'.*|\s*\zs.*'))
Tabularize/|/l1
normal! 0
call search(repeat('[^|]*|',column).'\s\{-\}'.repeat('.',position),'ce',line('.'))
@eculver
eculver / install_django_cms.sh
Created January 12, 2011 20:49 — forked from chrisglass/install_django_cms.sh
script to automagically create a django-cms-based project
#!/bin/bash
# This should be run on a relatvely modern version of Ubuntu (9.10 or later,
# without any sort of confidence)
PROJECT_NAME=$1
if [ x$PROJECT_NAME = "x" ] ; then
# No project name!
echo "Usage: $0 <project name>"
exit 1
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install
curl http://npmjs.org/install.sh | sh
@eculver
eculver / gist:615932
Created October 7, 2010 21:34 — forked from paulirish/gist:576335
Things to do when IE9 Beta comes out

Things to do when IE9 Beta comes out

Note significant features added since IE9 PP4

  • Implemented but not announced: box-shadow, hsla
  • Expecting: 2d transforms, css animation, css transitions, flexible box model
  • Maybe: gradients, columns, reflections, svg filters, uncrippling @font-face, 3d transforms
  • Maybe version auto-update functionality

Test Modernizr against it

  • Does it still throw an error checking elem.msTransform?
@eculver
eculver / gist:530619
Created August 17, 2010 16:15 — forked from padolsey/gist:527683
Super sexy IE detection
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
// And to detect the version:
// ie === 6 // IE6
// ie > 7 // IE8, IE9 ...