Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am mikepearce on github.
  • I am mikepearce (https://keybase.io/mikepearce) on keybase.
  • I have a public key ASC-VXnewzaICglgnjbobVpnVaBZGiFodIaucm-u3jb_mgo

To claim this, I am signing this object:

import time
# Set some vars
number_of_commuters = 1000
number_of_visible_steps = 20
steps_between_walkers = 2
complete_escalator_seconds = 60
total_time = 0
count = 0
@MikePearce
MikePearce / Contract Killer 3.md
Last active August 29, 2015 14:25 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

@MikePearce
MikePearce / Things to do after install Ubuntu
Created September 30, 2013 08:05
Things to do after you've installed Ubuntu
# Install tweak tools
sudo apt-get install unity-tweak-tool
sudo apt-get install gnome-tweak-tool
# Install compiz
sudo apt-get install compizconfig-settings-manager compiz-plugins-extra
# Disable guest and remote login accounts
sudo nano /etc/lightdm/lightdm.conf
allow-guest=false
@MikePearce
MikePearce / Xmodmap mapping
Last active December 23, 2015 14:29
Contents of ~/.Xmodmap. This allows the Ubuntu key mappings to behave (sort of) like OSX.
remove control = Control_L
remove mod4 = Super_L Super_R
keysym Control_L = Super_L
keysym Super_L = Control_L
keysym Super_R = Control_L
add control = Control_L Control_R
add mod4 = Super_L Super_R
pointer = 1 2 3 5 4 6 7 8 9 10 11 12

#Introduction If you're a php developer on ubuntu, there comes the time where you have to install/reinstall your system. I did it already a few times and i decided to write down the steps for a typical web developer stack with php. This is for a developer machine and not for live environment!

I hope it's a help also for you!

Setup OSX-like keymapping on Ubuntu: http://task3.cc/881/configure-the-keyboard-for-your-macbook-and-ubuntu-12-04/

@MikePearce
MikePearce / post-receive
Created November 1, 2012 01:11
Basic post-receive hook
#!/usr/local/bin/php
<?php
$staging_directory = '/var/www/engni_test/';
$webroot_directory = '/var/www/engni_test_live/';
echo "****************************************************\n";
echo "*** BEGIN POST-RECEIVE\n";
echo "****************************************************\n";
echo "*** 1. checkout test\n";
/**
* Click link or button to trigger js event
* (for buttons that submit forms, use "press"
*
* @When /^I click on the text "([^"]*)"$/
*/
public function iClickOnTheText($text)
{
$session = $this->getSession();
$element = $session->getPage()->find(
@MikePearce
MikePearce / gist:1129317
Created August 6, 2011 13:13
leedshack
<VirtualHost *:80>
ServerName leedshack.dev
DocumentRoot /Users/mikeypearce/Sites/leedshack/public
<Directory "/Users/mikeypearce/Sites/leedshack/public">
Options FollowSymLinks
#RewriteEngine On
#RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
#RewriteRule ^(.*)$ /Users/mikeypearce/Sites/leedshack/public/index.php [L]
Options FollowSymLinks
Given /^I am logged in as "([^"]*)" with password "([^"]*)"$/ do |user, password|
visit "http://www.website.com:82/login"
#Is there a 'logout'?
if (response_body.match('<span>Login</span>')) then
fill_in "email", :with => user
fill_in "password", :with => password
click_button "Login"
end
response_body.should contain("Your Accounts")