Skip to content

Instantly share code, notes, and snippets.

View rowan-m's full-sized avatar
🐢
I'll get to it eventually.

Rowan Merewood rowan-m

🐢
I'll get to it eventually.
View GitHub Profile
@rowan-m
rowan-m / tdd.sh
Created May 19, 2011 12:10
Watch existing PHP files in a directory and run phpunit on changes. Requires inotify-tools
#!/bin/bash
while true ; do
inotifywait -qq *.php &&
clear &&
phpunit --colors KataTest.php;
done
@rowan-m
rowan-m / gist:1026918
Created June 15, 2011 11:34 — forked from jedi4ever/gist:898114
update jenkins Updatecenter from CLI
$ java -jar jenkins-cli.jar -s http://localhost:9000 install-plugin findbugs
findbugs is neither a valid file, URL, nor a plugin artifact name in the update center
No update center data is retrieved yet from: http://updates.jenkins-ci.org/update-center.json
findbugs looks like a short plugin name. Did you mean 'null'?
# Specifying a full URL works!
$ java -jar jenkins-cli.jar -s http://localhost:9020 install-plugin http://updates.jenkins-ci.org/download/plugins/AdaptivePlugin/0.1/AdaptivePlugin.hpi
# Get the update center ourself
@rowan-m
rowan-m / nice-ionice-example.sh
Created May 14, 2012 12:30
Using nice and ionice
#!/bin/bash
# If the process is already running, you can use the following:
PID=`pgrep processname`
renice -n 19 $PID
ionice -c 3 -p $PID
# For new processes, just chain them together
nice -n 19 ionice -c 3 processname
@rowan-m
rowan-m / leethacks001.php
Created June 7, 2012 12:53
Estimation Test Attempts
<?php
$string = 'It is very difficult to make a vigorous, plausible, and job-risking defense of an estimate that is derived by no quantitative method, supported by little data, and certified chiefly by the hunches of the managers.';
$string = wordwrap($string, 80, '#');
$length = strlen($string);
$wordsPerLine = array();
$line = 1;
@rowan-m
rowan-m / make-history.sh
Created November 20, 2012 14:47
Turn lolcommits into a video slideshow set to music
#! /bin/bash
# Where lolcommits stores its images
LOLCOMMITS_DIR=/home/rowan/.lolcommits
# The subdirectory in the lolcommits directory you want to us
LOLCOMMITS_REPO=project
# Image mask used to blur commit message
BLUR_MASK_IMG=/home/rowan/mask.jpg
# Video frames per second
VIDEO_FPS=4
@rowan-m
rowan-m / ObservableTrait.php
Created January 21, 2013 10:46
Trait for providing behaviour from the observer pattern.
<?php
namespace Sorting;
trait ObservableTrait
{
private $observers = array();
public function addObserver(Observer $observer)
{
@rowan-m
rowan-m / log
Created February 8, 2013 21:32
What happens if you try to create an application version with an existing name?
rowan@swordbean:~/ground-up$ elastic-beanstalk-create-application-version -a asciigram -d 'Version from Zip file' \
-l tryToOverwrite -s elasticbeanstalk-us-east-1-837326383672/v20130208172455.zip
ApplicationName | DateCreated | DateUpdated | Description | SourceBundle | VersionLabel
---------------------------------------------------------------------------------------
asciigram | 2013-02-08 21:29:53 +0000 | 2013-02-08 21:29:53 +0000 | Version from Zip file | elasticbeanstalk-us-east-1-837326383672/v20130208172455.zip | tryToOverwrite
rowan@swordbean:~/ground-up$ elastic-beanstalk-create-application-version -a asciigram -d 'Version from Zip file' \
-l tryToOverwrite -s elasticbeanstalk-us-east-1-837326383672/v20130208172455.zip
Service returned an error.
Type: Sender
Code: InvalidParameterValue
@rowan-m
rowan-m / settings.php
Created March 20, 2013 15:13
Pulling RDS config from an Elastic Beanstalk environment for Drupal
<?php
// ---8<--- SNIP ---8<---
if (isset(
$_SERVER['PARAM2'], $_SERVER['RDS_HOSTNAME'], $_SERVER['RDS_PORT'], $_SERVER['RDS_USERNAME'], $_SERVER['RDS_PASSWORD']
)) {
$databases = array(
'default' =>
array(
@rowan-m
rowan-m / keybase.md
Last active June 15, 2018 10:28
Verification for keybase.io

Keybase proof

I hereby claim:

  • I am rowan-m on github.
  • I am rowan_m (https://keybase.io/rowan_m) on keybase.
  • I have a public key ASAobnJ4vRpPtn90NGmtUtBlAyJq0vCa8tlOnxt1xX19kQo

To claim this, I am signing this object:

@rowan-m
rowan-m / toggle-cpufreq.sh
Created November 10, 2017 15:27
Toggle CPU power governor
#!/bin/bash
CURRENT_GOVERNOR=`cpufreq-info -p | grep -oE '[^ ]+$'`;
NEW_GOVERNOR='performance';
echo "Current governor: $CURRENT_GOVERNOR";
if [ "$CURRENT_GOVERNOR" == "performance" ]; then
NEW_GOVERNOR="powersave";
fi