Skip to content

Instantly share code, notes, and snippets.

@thomd
thomd / dreamgit.sh
Created Mar 3, 2009
git repository on dreamhost
View dreamgit.sh
#!/bin/bash
#
# setup local and remote git repository (on dreamhost) for project in current folder and push initial commit
#
# Author: thomd < thomduerr@gmail.com >
#
#
# Current Version: 1.2
#
# Version 1.2
@thomd
thomd / userscript-updater.user.js
Created Mar 27, 2009
userscript updater snippet
View userscript-updater.user.js
// ==UserScript==
// @name easy userscript updater snippet
// @namespace http://thomd.net/userscript
// @description copy-paste this updater script snippet at the end of your userscript file hosted on userscripts.org. Your script is now displaying update notifications the next time you upload a new version of your script.
// @include http://domain-name.tld/*
// @author Thomas Duerr
// @version 1.0.1
// @date 2009-03-27
// ==/UserScript==
@thomd
thomd / httpdump
Created Apr 4, 2009 — forked from peterc/httpdump
httpdump
View httpdump
# Monitor HTTP requests being made from your machine with a one-liner..
# Replace "en1" below with your network interface's name (usually en0 or en1)
sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E "Host\: .*|GET \/.*"
# OR.. to be able to use as "httpdump" from anywhere, drop this into ~/.bash_profile:
# (again replace "en1" with correct network interface name)
alias httpdump='sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E "Host\: .*|GET \/.*"'
# All the above tested only on OS X.
@thomd
thomd / svn-pa.sh
Created May 5, 2009
shortcut for svn-propadd
View svn-pa.sh
#!/bin/bash
#
# add the value if a property on files
#
# Example of usage:
# $ svn pg svn:ignore .
# baz
# $ ./svn-pa.sh svn:ignore foo .
# $ svn pg svn:ignore .
# baz
@thomd
thomd / statsvn.sh
Created May 5, 2009
generate statsvn stats
View statsvn.sh
#!/bin/bash
STATSVN="C:/lib/java/statsvn-0.4.1/statsvn.jar"
TARGET="stats"
LOG="svn.log"
PROJECT_NAME=$(basename $PWD)
PROJECT_ROOT=$PWD
SVN_URL=$(svn info | grep URL | sed "s/URL: //g")
# get logfile
@thomd
thomd / svn-tag.sh
Created May 7, 2009
shortcut for a svn-tag
View svn-tag.sh
#!/bin/bash
#
# shortcut for a svn tag-copy
#
# thomduerr@gmail.com
#
# set path to svn-repository
REPO="http://localhost/svn/project"
View dollarX.js
// simple version of $X
// $X(exp);
// $X(exp, context);
// @source http://gist.github.com/3242.txt
function $X (exp, context) {
context || (context = document);
var expr = (context.ownerDocument || context).createExpression(exp, function (prefix) {
return document.createNSResolver(context.documentElement || context).lookupNamespaceURI(prefix) ||
context.namespaceURI || document.documentElement.namespaceURI || "";
});
@thomd
thomd / .gitignore
Created Jun 11, 2009
rails .gitignore
View .gitignore
config/database.yml
*~
*.cache
*.log
*.pid
tmp/**/*
.DS\_Store
db/cstore/**
doc/api
doc/app
View gist:132876
# Bash snippet to open new shells in most recently visited dir.
# Useful if you want to open a new terminal tab at the present
# tab's location.
#
# Put this in your .bashrc or whatever.
pathed_cd () {
if [ "$1" == "" ]; then
cd
else
@thomd
thomd / things.template.rb
Created Jul 24, 2009
things-app rails template
View things.template.rb
#
# rails template for things application
#
# usage:
# rails things -m "things.template.rm"
#
run "rm public/index.html"