Skip to content

Instantly share code, notes, and snippets.

Colin Burn-Murdoch colinbm

Block or report user

Report or block colinbm

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@colinbm
colinbm / Contract Killer 3.md
Created Jan 22, 2018 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers
View Contract Killer 3.md

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@colinbm
colinbm / cloudflare_control.rb
Created Sep 9, 2014
Pause or resume all your CloudFlare sites at once. Useful if CloudFlare is misbehaving.
View cloudflare_control.rb
#!/usr/bin/env ruby
require 'cloudflare'
module CloudFlare
class Connection
public :send_req
end
end
@colinbm
colinbm / chgrp-www-data
Last active Dec 22, 2015
Allow any user to change the group of a file or directory within their home directory to www-data. Usage sudo chown-www-data <path>
View chgrp-www-data
#! /usr/bin/env ruby
require 'pathname'
require 'etc'
require 'shellwords'
path = ARGV.first
user = ENV['SUDO_USER']
SAFE_PATH_PREFIX = "/home/#{user}/"
@colinbm
colinbm / update_ctime.rb
Last active Dec 14, 2015
Correct the creationtime of photos based on EXIF data.
View update_ctime.rb
require 'exifr'
files = Dir['**/*']
files.each do |file|
if File.file?(file) && File.extname(file).downcase == '.jpg'
begin
exif = EXIFR::JPEG.new(file)
if !exif.date_time_original.nil?
File.utime(exif.date_time_original, exif.date_time_original, file)
@colinbm
colinbm / wpget.php
Created Apr 2, 2012
Class to wrap WordPress functions and return instead of echo
View wpget.php
<?php
class WpGet {
public static function __callStatic($name, $args) {
if (function_exists($name)) {
ob_start();
$name($args);
$result = ob_get_contents();
ob_end_clean();
return $result;
@colinbm
colinbm / gist:1843685
Created Feb 16, 2012
wkhtmltopdf settings for print
View gist:1843685
For A3:
wkhtmltopdf --page-width 297 --page-height 420 --dpi 300 --margin-right 0 --margin-top 0 --margin-bottom 0 --margin-left 0 http://wktest.local ~/Desktop/wktest.pdf
body {
margin: 0;
padding: 0;
background: #ccc;
height: 420mm;
width: 297mm;
@colinbm
colinbm / crontab.txt
Created Nov 17, 2011
Quick reference header for all my crontabs - stolen/modified from wikipedia
View crontab.txt
# /───────────────────────── min (0 - 59)
# │ /──────────────────── hour (0 - 23)
# │ │ /─────────────── day of month (1 - 31)
# │ │ │ /────────── month (1 - 12)
# │ │ │ │ /───── day of week (0 - 7) (Sunday=0 or 7)
# │ │ │ │ │
# * * * * * command to be executed
@colinbm
colinbm / gist:1191441
Last active Sep 27, 2015
Banana, Dark Chocolate, & 5AM Saint Bread Cake
View gist:1191441
Banana, Dark Chocolate, & 5AM Saint Cake
See https://twitter.com/colinbm/status/110026973681684480
100 g wholemeal flour
130 g self raising flour
200 g sugar
1/2 tsp salt
1/2 tsp cinnamon
1/2 tsp baking powder
You can’t perform that action at this time.