Skip to content

Instantly share code, notes, and snippets.

View stephen-hill's full-sized avatar

Stephen Hill stephen-hill

View GitHub Profile
@stephen-hill
stephen-hill / pdo-fetch-benchmark.php
Created May 3, 2013 10:52
Benchmark for the different PDO fetch styles.
<?php
set_time_limit(0);
// List of fetch styles to test
$fetchStyles = array(
'Assoc' => PDO::FETCH_ASSOC,
'Both' => PDO::FETCH_BOTH,
'Lazy' => PDO::FETCH_LAZY,
'Num' => PDO::FETCH_NUM,
@stephen-hill
stephen-hill / total-steam-price.php
Created August 12, 2013 11:53
This script will calculate the total price of everything on the Steam UK store. Designed to be run from the PHP CLI. Requires cURL.
<?php
header('Content-Type: text/plain');
$total = 0;
$id = 0;
$apps = array();
set_time_limit(0);
// Get a list of all valid apps
$applist = file_get_contents('http://api.steampowered.com/ISteamApps/GetAppList/v2');
$applist = json_decode($applist);
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\9bis.com\KiTTY\Sessions\SESSION_NAME]
"Colour21"="255,255,255"
"Colour20"="245,222,179"
"Colour19"="200,240,240"
"Colour18"="0,217,217"
"Colour17"="179,146,239"
"Colour16"="174,129,255"
"Colour15"="122,204,218"
sudo apt-get update
sudo apt-get install munin-plugins-extra
cd /etc/munin/plugins
sudo ln -snf /usr/share/munin/plugins/memcached_ memcached_bytes
sudo ln -snf /usr/share/munin/plugins/memcached_ memcached_counters
sudo ln -snf /usr/share/munin/plugins/memcached_ memcached_rates
sudo aptitude install libcache-memcached-perl
sudo /etc/init.d/munin-node restart
sudo tail -f /var/log/munin/munin-node.log
<?php
/**
* Copy Photos
*
* I made this script to copy photographs from my memory card to my network storage device.
*
* The MIT License (MIT)
*
* Copyright (c) 2014 Stephen Hill <stephen@gatekiller.co.uk>

Keybase proof

I hereby claim:

  • I am stephen-hill on github.
  • I am stephenhill (https://keybase.io/stephenhill) on keybase.
  • I have a public key whose fingerprint is CC3E 4529 85AC 469E 869E 940F BC2B 6754 C461 5BF4

To claim this, I am signing this object:

@stephen-hill
stephen-hill / rsa.php
Last active August 29, 2015 14:06
php-rsa
<?php
# Code ported from http://code.activestate.com/recipes/578838-rsa-a-simple-and-easy-to-read-implementation/
function getPrimes($start, $stop)
{
$primes = array(2);
$range = range(3, $stop + 1, 2);
foreach ($range as $n) {
@stephen-hill
stephen-hill / new-ssc
Created January 27, 2015 11:12
Create a new Self-Signed OpenSSL Certificate
openssl req -x509 -nodes -days 36500 -newkey rsa:4096 -sha256 -keyout private.key -out certificate.crt
@stephen-hill
stephen-hill / Default (Windows).sublime-keymap
Last active August 29, 2015 14:14
Sublime Text Settings
[
{ "keys": ["ctrl+alt+d"], "command": "delete_trailing_spaces" }
]
@stephen-hill
stephen-hill / .conkyrc
Last active August 29, 2015 14:16
Conky Config
############
# Settings #
############
background yes
use_xft yes
xftfont Droid Sans:size=9
xftalpha 1
update_interval 5
total_run_times 0
own_window yes