Skip to content

Instantly share code, notes, and snippets.

@dkinzer
dkinzer / testOpenThenFunction.js
Created December 2, 2012 21:03
Test Casper#openThen() evaluates with current object.
var url = 'http://casperjs.org';
var casper = require('casper').create();
var t = casper.test;
var Test = function() {
this.url = 'http://casperjs.org';
this.paths = {
quickstart : '/quickstart.html',
install : ''
@dkinzer
dkinzer / gist:4286103
Created December 14, 2012 15:06
Example of how to run a shell script immune to hangups
nohup ./script_name.sh &
@dkinzer
dkinzer / .bash_profile
Created February 15, 2013 16:48
This is .bash_profile to get my windows Vagrant and Chef environment working nicely within the sh.exe shell that comes with Git-Bash for Windows.
VIMDIR="$HOME/AppData/Local/Temp/Temp1_vim73-x64.zip/vim73"
DevKit="/c/DevKit/bin"
MingW="/c/DevKit/mingw/bin"
rsync="/c/rsync"
ssh="/c/cygwin-ssh/ssh"
PATH="$ssh:$rsync:$VIMDIR:$PATH:$DevKit:$MingW"
export PATH
# Aliases
#!/bin/bash
for font in $(ls /usr/share/figlet | grep '.flf')
do
echo '=================================================================='
echo $font
figlet -cf $font "Heaven's"
figlet -cf $font "Kitchen"
echo '=================================================================='
done
@dkinzer
dkinzer / live-git-pull-task
Created April 25, 2013 14:14
A phing task that uses drush to pull git source from a remote environment.
<target name='live-git-pull'>
<exec command="drush dd @live:%git-dir" outputProperty="git-dir" />
<exec command="drush dd @live:%work-tree" outputProperty="work-tree" />
<exec command="drush @live exec git --git-dir='${git-dir}/' --work-tree='${work-tree}' fetch origin" checkreturn='true' escape='false' />
<exec command="drush @live exec git --git-dir='${git-dir}/' --work-tree='${work-tree}' merge origin/live" checkreturn='true' escape='false' />
</target>
@dkinzer
dkinzer / gist:5691974
Last active December 17, 2015 23:49
Test drush features export.
/**
* Tests Features' Drush integration.
*/
class FeaturesDrushExportTest extends DrupalWebTestCase {
protected $profile = 'testing';
/**
* Test info.
*/
public static function getInfo() {
@dkinzer
dkinzer / amend.sh
Created July 23, 2013 15:37
Some scripts that help with clojure enlightenment. Assumption: you are using [lein](https://github.com/technomancy/leiningen) with [clojure-koans](https://github.com/functional-koans/clojure-koans)
#!/bin/bash
if [ "$1" ]
then
git add -u && git commit --amend -m "$1" && koan
else
git add -u && git commit --amend && koan
fi
@dkinzer
dkinzer / gist:6065472
Created July 23, 2013 19:37
Hide repo changes in sub-modules added by pathogen. attribution: http://stackoverflow.com/a/10061855/256854
for s in `git submodule --quiet foreach 'echo $name'` ; do git config submodule.$s.ignore untracked ; done
@dkinzer
dkinzer / gist:8637554
Last active January 4, 2016 14:59
Multiple steps in a (do..) expression do not have the same effect as a (doseq...) that look like they should behave the same way.
; repl-options init using (do) form
; Wrapping the individual (ns...) expressions in a (do) form results in
; the expected behavior; the REPL recognizes functions defined in koan-engine.core etc.
(defproject clojure-koans "0.5.0-SNAPSHOT"
:repl-options {
:init-ns koan-engine.runner
:init (do
(ns koans.12-creating-functions (:use koan-engine.core))
(ns koan-engine.runner (:use koan-engine.core))))
@dkinzer
dkinzer / remove-unused.sh
Last active August 29, 2015 14:03
Remove unused modules from repo.
#!/bin/bash
modules=( \
contemplate mollom nca_ahah panels \
pdf_to_imagefield apachesolr_sort scheduler \
uc_add_donation uc_ssl webform \
data schema wp_redirect suggestions ezproxy quicktabs \
taxonomy_access views_horizontal_slides colorbox)
for module in ${modules[@