Skip to content

Instantly share code, notes, and snippets.

@shanestillwell
shanestillwell / install.sh
Last active December 11, 2015 03:09
Install items needed to run node.js tests on Jenkins
#!/bin/bash
NPM=/usr/local/bin/npm
git clone https://github.com/isaacs/nave.git
./nave/nave.sh usemain v0.8.9
$NPM install -g mocha
$NPM install -g chai
$NPM install -g xunit-file
$NPM install -g jshint
@shanestillwell
shanestillwell / directive.js
Created December 24, 2012 20:46
AngularJS update model upon input blur
function Main() {}
// override the default input to update on blur
angular.module('app', []).directive('ngModelOnblur', function() {
return {
restrict: 'A',
require: 'ngModel',
link: function(scope, elm, attr, ngModelCtrl) {
if (attr.type === 'radio' || attr.type === 'checkbox') return;
@shanestillwell
shanestillwell / test.js
Created December 24, 2012 01:11
catching an thrown error with ChaiJS
(function () {
new Bill(input);
}).should.throw(Error);
@shanestillwell
shanestillwell / db.js
Created December 20, 2012 20:47
Finding MongoDB array that is NOT empty but exists
db.device.find({​"deviceTokens":{"$not":{"$size":0},$exists: 1}});
@shanestillwell
shanestillwell / Jenksin_env_vars
Created December 19, 2012 16:28
Running Testacular from Jenkins CI using PhantomJS. You'll need to install PhantomJS and Testacular onto the CI server. Then you'll need to set up a New Job in Jenkins.
PATH=$PATH:/usr/local/bin
PHANTOMJS_BIN=/usr/local/bin/phantomjs
@shanestillwell
shanestillwell / upload2youtube.php
Created December 8, 2012 13:40
Upload files to YouTube with a Zend Framework script
#!/usr/bin/php
<?php
/**
* Put this in your ./scripts folder
* Make it executeable (chmod +x)
*
* Usage:
* Edit the interesting bits below put in your own keys and such
* ./upload2youtube.php
@shanestillwell
shanestillwell / install_puppet_mac.sh
Created November 27, 2012 18:32 — forked from rija/install_puppet_mac.sh
Installing Puppet on Mac OS X
#!/usr/bin/env bash
set -o errtrace
set -o errexit
facter_version=$1
puppet_version=$2
target_volume=$3
@shanestillwell
shanestillwell / Makefile
Created November 12, 2012 04:00
Makefile for MochaJS
all: test
test: ;
@export NODE_PATH=/usr/local/lib/node_modules; \
mocha
test-w: ;
@export NODE_PATH=/usr/local/lib/node_modules; \
mocha -w
@shanestillwell
shanestillwell / amazonS3.js
Created October 18, 2012 18:46 — forked from zhendershot/gist:3607211
REST API Upload to S3 in Titanium
var config = require('/modules/config'); /// Holds information on amazonkey and secret
/**
*
* UTF-8 data encode / decode
* http://www.webtoolkit.info/
*
**/
var Utf8 = {
@shanestillwell
shanestillwell / compile_im.sh
Created September 28, 2012 19:38
Compile Imagemagick on os x
# Author: Claudio Marforio
# e-mail: marforio@gmail.com
# date: 1.05.2010
# Script to make static libraries (jpeg + png) and ImageMagick
# the libraries will be conbined into i386+arm.a static libraries
# to be used inside an XCODE project for iPhone development
# If everything works correctly you will end up with a folder
# on your ~/Desktop ready to be imported into XCode