Skip to content

Instantly share code, notes, and snippets.

View dkinzer's full-sized avatar

David Kinzer (he/him) dkinzer

View GitHub Profile
@bcardarella
bcardarella / .bash_profile
Created February 4, 2009 22:25
Git Autocompletion
source ~/.git-completion.sh
alias gco='git co'
alias gci='git ci'
alias grb='git rb'
@tim-smart
tim-smart / ctags definitions for Javascript
Created October 2, 2009 00:07
CTags Definitions for Javascript
--langdef=js
--langmap=js:.js
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*\{/\5/,object/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*function[ \t]*\(/\5/,function/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*\[/\5/,array/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*[^"]'[^']*/\5/,string/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*(true|false)/\5/,boolean/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*[0-9]+/\5/,number/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*.+([,;=]|$)/\5/,variable/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*[ \t]*([,;]|$)/\5/,variable/
@zachwaugh
zachwaugh / gist:521133
Created August 12, 2010 15:19
Loading rails environment in a script
#!/usr/bin/env ruby
# Load Rails
ENV['RAILS_ENV'] = ARGV[0] || 'production'
DIR = File.dirname(__FILE__)
require DIR + '/../config/environment'
# ... do stuff that requires using your rails models
@adamsanderson
adamsanderson / test_mail_purge.rb
Created December 18, 2010 04:35
An example of using MiniTest::Mock
require 'minitest/mock'
require 'minitest/unit'
require 'date'
MiniTest::Unit.autorun
class TestMailPurge < MiniTest::Unit::TestCase
class MailPurge
def initialize(imap)
@imap = imap
@sit
sit / .gitignore
Created January 14, 2011 19:44
A basic .gitignore file for Hudson configurations
# The following ignores...
# Miscellaneous Hudson litter
*.log
*.tmp
*.old
*.bak
*.jar
*.json
# Generated Hudson state
@lox
lox / JUnitReporter.php
Created April 21, 2011 18:57
A SimpleTest Reporter that outputs JUnit compatible XML
<?php
/**
* A reporter that writes jUnit xml files
*/
class JUnitReporter extends SimpleReporter
{
private $_dom;
private $_tests=array();
private $_test;
@cwjohnston
cwjohnston / ssh_wrapper.sh.erb
Created June 23, 2011 16:51
an example ssh wrapper script to be used with the chef deploy resource
#!/bin/bash
ssh -i<%= @node[:deploy][:key_path] %>/<%= @appname %>_deploy_key -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $1 $2
@fundon
fundon / vim_centos.sh
Created August 17, 2011 03:52
install vim 7.3 on centos, debian, arch etc.
#!/bin/bash
# on centos minimal
yum install gcc
yum install make
yum install ncurses-devel
yum install lua lua-devel
yum install ruby ruby-devel
yum install python python-devel
yum install perl perl-devel
@gavinwilliams
gavinwilliams / build.xml
Created September 7, 2011 10:02
This ant task will automatically clear your Drupal cache with every build/save. Gone are the days of logging into the admin panel to clear the Drupal cache to preview your template or modifying Drupal to get around it!
<!--
1. Download and add drush to your template folder or put it somewhere on your computer and symlink it - http://drupal.org/project/drush
2. Add the following task to your Ant build file after your deployment tasks
3. 'dir' is the path to your local deployment i.e. /Users/yourname/Sites/yourwebsite/public_html
4. 'executable' is the path to your drush command. Simply use drush in this attribute if you have symlinked it
-->
<exec dir="${path.deploy}" executable="${directory.build.tools}/drush/drush" failonerror="true" output="/dev/null">
<arg line="cache-clear all" />
</exec>
@tomster
tomster / .gitconfig
Created September 25, 2011 11:48
An example git configuration including convenience aliases, some saner default behavior, a neat shell prompt and tab completion that can display the name of the tracking remote
# ~/.gitconfig
[branch]
autosetupmerge = true
[push]
default = current
[core]
excludesfile = .gitignore