Skip to content

Instantly share code, notes, and snippets.

View Pezmc's full-sized avatar

Pez Cuckow Pezmc

View GitHub Profile
@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
@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 / 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 / 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 / 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 / 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 / bgg-geeklist-game-adder.js
Created August 1, 2018 16:06
Automatically add a list of games to a Board Game Geek GeekList
//= Usage
// Update the config below
// Paste this file into the console on the edit geeklist page
// Call addAllGames()
// Config
let gamelist = []; // Set this to an array containing the names of games you wish to add
// e.g. let gamelist = ["Azul", "Carcassonne", "Codenames"];
// Exposed so they can be logged
JSON.stringify($('.filter-susd-recommends').map(function() { return $(this).find('.eg-games-page-element-1').text() }).toArray())
@Pezmc
Pezmc / parseRunGap.sh
Last active March 2, 2019 11:02
Parse RunGap Metadata
cat *.metadata.json | jq -c '"\(.distance), \(.duration), \(.startTime.time), \(.avgHeartrate), \(.maxHeartrate), \(.activityType.internalName)"' | grep "Running" | grep -v "Treadmill"
@Pezmc
Pezmc / old-pr-deploy.js
Last active October 19, 2020 14:48
Copy the current PR to your clipboard
function copytext(a) {
var b = document.createElement("textarea");
b.innerText = a, document.body.appendChild(b), b.select(), document.execCommand("copy"), b.remove()
}
copytext("@cobot deploy harvestapp: PR " + document.querySelector('.gh-header-number').innerText + " - " + document.querySelector('.js-issue-title').innerText.trim() + ", see " + window.location);