Skip to content

Instantly share code, notes, and snippets.

View statico's full-sized avatar

Ian Langworth ☠ statico

View GitHub Profile
@snb
snb / virtualbox_ports.png
Created January 24, 2010 01:46
virtualbox serial console
virtualbox_ports.png
#!/usr/bin/env python
#
# fancyoutput.py - quick functions to make script output pretty
#
# by Ian Langworth, 2010
#
# This code is in the public domain.
#
import sys
@statico
statico / settings_local.py
Created March 29, 2011 18:29
Additions to settings_local.py
# Change these to your libgeos paths!
GEOS_LIBRARY_PATH = '/opt/local/lib/libgeos_c.dylib'
GDAL_LIBRARY_PATH = '/opt/local/lib/libgdal.dylib'
GEOIP_LIBRARY_PATH = '/opt/local/lib/libGeoIP.dylib'
GEOIP_PATH = '/opt/local/share/GeoIP/'
# Disable compression if you need to debug JavaScript. You need to set both.
COMPRESS = False
ASSETS_DEBUG = True
@mads-hartmann
mads-hartmann / Coffeescript ctags
Created April 7, 2011 07:44
ctags definitions for Coffeescript. Very basic for now. "> ctags -e -R source_folder" and then M-. to jump to the definition of any function or variable (if you're using emacs)
--langdef=coffee
--langmap=coffee:.coffee
--regex-coffee=/^[ \t]*([A-Za-z.]+)[ \t]+=.*->.*$/\1/f,function/
--regex-coffee=/^[ \t]*([A-Za-z.]+)[ \t]+=[^->\n]*$/\1/v,variable/
@danwerner
danwerner / pre-commit
Created June 3, 2011 15:24 — forked from jonasvp/pre-commit
My .git/hooks/pre-commit - save yourself from embarassment using pyflakes
#!/bin/bash
# Original version (C) 2011 by jonasvp
# Modified version by danwerner
# Save this file as .git/hooks/pre-commit, make it executable, and it will
# thank you by saving you from common mistakes *before* deployment.
# Conflict markers
git diff --cached --diff-filter=ACMR | awk '/\+(<<<[<]<<<|>>>[>]>>>|===[=]===$)/ { exit 1 }'
CODE=$?
@tbeseda
tbeseda / basic_auth_app.coffee
Created December 29, 2011 21:19
Basic HTTP Auth with Express for Node.js
express = require 'express'
app = express.createServer()
auth = express.basicAuth 'yourmom', 'p4ssw0rd'
app.get '/', auth, (req, res) ->
res.send your_super_secret_stuff
app.listen 3000, ->
console.log "Listening on #{port}"
@crimeminister
crimeminister / prepare-commit-msg.py
Created January 1, 2012 00:11
Git hook to insert word count into commit message.
#!/usr/bin/python3
#
# A hook script to prepare the commit log message.
#
# Called by git-commit with the name of the file that has the commit
# message, followed by the description of the commit message's source.
# The hook's purpose is to edit the commit message file. If the hook
# fails with a non-zero status, the commit is aborted.
import glob
@rgo
rgo / gist:2025990
Created March 13, 2012 01:16
Gnome-shell dual monitor separate workspaces
# By default the behavior is:
# Primary monitor work as always and second monitor only have one and fixed workspace
# I.e. you change to next workspace, primary monitor change to this workspace and second monitor remain as is.
# The desired behaviour is:
# Primary monitor and secondary monitor are linked workspace.
# I.e. you change to next workspace, primary monitor change to this workspace and second monitor too.
$ gconf-editor
# Look for /desktop/gnome/shell/windows/workspaces_only_on_primary and set to false
@Jared-Prime
Jared-Prime / gist:2423065
Created April 19, 2012 18:57
Converting RGB to HEX in Ruby
# Beginning Rubyists: simply run >> ruby hex-convertions.rb to see examples
# or use irb to build the code on the fly
# you can convert HEX to DEC using the method .to_i(base),
# which converts a string to a decimal number from the specified base number
puts "00".to_i(16)
puts "FF".to_i(16)
@digitarald
digitarald / build.coffee
Created May 1, 2012 20:54
Building require.js
requirejs = require('requirejs')
jspath = __dirname + '/views/scripts';
requirejs.optimize(
baseUrl: jspath
wrap:
start: ';(function(undefined) { "use strict";'
end: '}).call(this);'