Skip to content

Instantly share code, notes, and snippets.

View gooh's full-sized avatar

Gordon Oheim gooh

View GitHub Profile
@gooh
gooh / gist:c8e00b99ef02a6eca602
Created June 7, 2015 10:09
Renames all files in a folder having an extension to a sequential numeric name preserving existing numerically named file names
<?php
$baseDir = $argv[1];
if (false === is_dir($argv[1])) {
die ("$baseDir is not a directory");
}
// get all files with an extension
$allFiles = array_filter(
array_map('pathinfo', glob("$baseDir/*")),
@gooh
gooh / main.rs
Created July 27, 2015 12:37
A simple secure password generator
extern crate rand;
extern crate docopt;
extern crate rustc_serialize;
use rand::{OsRng, Rng};
use docopt::Docopt;
static USAGE: &'static str = "
Usage: rpgen [options]
rpgen --help
@gooh
gooh / responses.js
Created January 12, 2016 13:46
Swordfighting for Might Pirates; requires https://www.npmjs.com/package/hubot-response
[
{
"match": "You fight like a Dairy Farmer!",
"description": "swordfighting for might pirates",
"listener": "hear",
"response": "How appropriate! You fight like a cow!"
},
{
"match": "This is the END for you, you gutter crawling cur!",
"description": "swordfighting for might pirates",