Skip to content

Instantly share code, notes, and snippets.

View Pezmc's full-sized avatar

Pez Cuckow Pezmc

View GitHub Profile
@Pezmc
Pezmc / keybase.md
Last active April 7, 2016 10:03
Publicly-auditable identity

Keybase proof

I hereby claim:

  • I am pezmc on github.
  • I am pezcuckow (https://keybase.io/pezcuckow) on keybase.
  • I have a public key ASDyRK69_gUJaGEqUKFiNvw93DXHivcblE_tIT87gPooego

To claim this, I am signing this object:

@Pezmc
Pezmc / Speedsums
Last active August 29, 2015 14:08
Who Needs Maths
var cheatInsteadOfPlayingTheGameProperlyAndImprovingYourMentalArithmatic = function() {
var q = $("#question").text();
q = q.substr(0, q.length - 2).replace('÷', '/').replace('x', '*');
$("#answer").val(eval(q)).keydown().keyup().keypress();
}
setInterval(cheatInsteadOfPlayingTheGameProperlyAndImprovingYourMentalArithmatic, 250);
@Pezmc
Pezmc / pre-commit
Created August 7, 2014 18:38
Git pre-commit prevent commit of certain files
#!/bin/sh
error_found=false
declare -a BANNED_PATTERNS=("app/config/database.php")
# Terminal
if [ -t 1 ]; then
ncolors=$(tput colors)
if test -n "$ncolors" && test $ncolors -ge 8; then
@Pezmc
Pezmc / houses.js
Created June 11, 2014 08:36
Rightmove and Zoopla information grabbing bookmarklet
var string = '';
if(location.host == 'www.zoopla.co.uk') {
string += $('#listing-details h1').text().replace('to rent', '') + "\t";
string += $('.listing-details-address h2').text().split(',')[0] + "\t";
string += $('.listing-details-price.text-price').text().match(/\d+/gi)[0] + "\t";
string += $('.sidebar strong a[href^="/find-agents/"]').text() + "\t";
}
if(location.host == 'www.rightmove.co.uk') {
@Pezmc
Pezmc / TemplateUsernameGenerator.php
Created April 22, 2014 11:24
PHP Username Generator Using the Template Pattern
abstract class UsernameGenerator {
private $user;
abstract function generateUsername();
public function getUsername($user) {
$this->user = strtolower($user);
return $this->generateUsername();
}
protected function getFirstName() {
@Pezmc
Pezmc / hack.sh
Created March 31, 2012 10:55 — forked from erikh/hack.sh
Osx for Pez
#!/usr/bin/env sh
##
# Customised for personal use, some things changed.
#
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh