Skip to content

Instantly share code, notes, and snippets.

@simondean
simondean / gulpfile.js
Last active June 23, 2023 09:46
Gulp - Creating multiple bundles with Browserify - globs
// Comes from http://fettblog.eu/gulp-browserify-multiple-bundles/
'use strict';
var gulp = require('gulp'),
source = require('vinyl-source-stream'),
rename = require('gulp-rename'),
browserify = require('browserify'),
glob = require('node-glob'),
es = require('event-stream');
# Upgrading Bash
* http://apple.stackexchange.com/a/24635
json = json.unpack('U*').map {|i| i < 128 ? i.chr : "\\u#{i.to_s(16).rjust(4, '0')}"}.join
# Here is how to create an option/argument with mixlab-cli that can be assigned multiple values
# Hash
option :env,
:description => "Environment variable to pass to Cucumber. Can be specified more than once to set multiple environment variables",
:short => '-n NAME=VALUE',
:long => '--env NAME=VALUE',
:proc =>
lambda do |c|
@env ||= {}
#! /usr/bin/env ruby
require 'json'
require 'socket'
require 'time'
# Create a string containing 1 megabyte of data
output = 'A' * ((1 * 1024 * 1024) + 1)
sensu_events = 2.times.map do |i|
@simondean
simondean / check_cucumber.json
Created August 4, 2014 21:59
Example Sensu config for check-cucumber
{
"checks": {
"check_cucumber_example": {
"handlers": ["default"],
"command": "check-cucumber.rb --name cucumber-example --handler cucumber --metric-handler metrics --metric-prefix example-metrics-prefix --command \"node_modules/.bin/cucumber-js -f json features/\" --working-dir /var/cucumber-example/",
"interval": 300,
"subscribers": [ "cucumber" ]
}
}
}
echo '{
"handlers": ["email"],
"name": "it_is_cornbread_time",
"output": "Yummy!",
"status": 2,
"source": "server.example.org"
}' | nc -w1 127.0.0.1 3030
echo '{
"type": "metric",
# See https://www.lonelycoder.com/redmine/boards/14/topics/3368
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:adamsutton/tvheadend
sudo apt-get install tvheadend
@simondean
simondean / gist:4190964
Created December 2, 2012 20:40
Installing Android Jelly Bean on an HTC HD2 (Leo)
# Install Windows Mobile Device Center 6.1
http://www.microsoft.com/en-gb/download/details.aspx?id=3182
# Install Hspl4. select SPL 2.08.HSPL
http://forum.xda-developers.com/showpost.php?p=5279236&postcount=4
# Install Google Device Driver. This allows Android to connect to the PC
# Open Device Manager, find the unknown device and update the driver by pointing it at
# the Google Android Drivers directory
http://forum.xda-developers.com/showpost.php?p=21071699&postcount=73
# Install cLK. Select 400MB for System Partition and 5MB for Cache
http://forum.xda-developers.com/showthread.php?t=1402975
@simondean
simondean / setup-statsd.sh
Last active September 9, 2016 14:13 — forked from jasonroelofs/setup-statsd.sh
Turn an Ubuntu 12.04 LTS EC2 into a StatsD/Graphite server
# update apt's package list
sudo apt-get update
# install git
sudo apt-get install g++ curl libssl-dev apache2-utils
sudo apt-get install git-core
# install node
sudo apt-get install nodejs
# install the Node package manager (npm) for later use
sudo apt-get install npm
sudo npm install express