Skip to content

Instantly share code, notes, and snippets.

View webercoder's full-sized avatar
🌴

Mike Weber webercoder

🌴
  • Sydney, Australia
  • 07:12 (UTC +10:00)
View GitHub Profile
@webercoder
webercoder / thebestvideogamesever.txt
Created February 15, 2011 09:37
Best Video Games of All Time
Portal
Super Mario Bros. 3
World of Warcraft
Counter-Strike
Starcraft
Marathon
The Legend of Zelda: Link's Awakening
Tetris for Game Boy
Sonic the Hedgehog
Doom
@webercoder
webercoder / inception-javascript.js
Created April 1, 2011 06:31 — forked from fcalderan/inception-javascript.js
inception explained recursively
/*
* Fabrizio Calderan, twitter @fcalderan, 2010.11.02
* I had an idea: could Inception movie be explained by a few javascript closures
* and variable resolution scope (just for fun)?
*
* Activate javascript console =)
*/
<script>
console.group("inception movie");
@webercoder
webercoder / oac-giveaway-picker.js
Last active October 8, 2015 14:07
Order and Chaos Giveaway Picker
function getRandom(min, max) {
var randomNum = Math.random();
console.log(min + ', ' + max + ', ' + randomNum);
return min + Math.floor(Math.random() * (max - min + 1));
}
function getPlayer() {
var shadowRiders = ['user', 'list', 'here'];
var min = 1;
var max = shadowRiders.length;
@webercoder
webercoder / facebook-hide-post-form.user.js
Last active December 11, 2015 02:39
This is a user.js file that will hide the post form in Facebook.
// ==UserScript==
// @name Facebook Hide Post
// @namespace Facebook
// @description Hide post
// @include https://*/*
// @include http://*/*
// @grant none
// @version 1
// ==/UserScript==
document.getElementById('pagelet_composer').style.display = "none";
@webercoder
webercoder / gameloft-forums-readable.user.js
Last active December 13, 2015 18:38
User JS file that removes unnecessary elements from the gameloft forums.
// ==UserScript==
// @name Gameloft Forums Readable
// @namespace Gameloft
// @description Make the site more readable and less in your face.
// @include http://onlinegames-forum.gameloft.com/*
// @include https://onlinegames-forum.gameloft.com/*
// @grant none
// @version 1
// ==/UserScript==
@webercoder
webercoder / incremental-backup.sh
Created July 17, 2013 07:56
Converting this to a gist and blowing away the repo. Never been used, probably never will be.
#!/bin/bash
# Inspired by http://www.mikerubel.org/computers/rsync_snapshots/
# Command Line Options
PREFIX=$1
COUNT=$2
SOURCE_DIRECTORY=$3
DESTINATION_DIRECTORY=$4
EXCLUDES=$5
@webercoder
webercoder / convert_xml_to_json.js
Last active December 20, 2015 07:39
node.js script to convert XML to JSON. Saves a file called converted.json to the input file's directory. Usage: node convert_js_to_json.js filename.xml [pretty]
var xml2js = require("xml2js");
var fs = require("fs");
var path = require("path");
if (process.argv.length < 2)
throw new Exception("Usage: node " + process.argv[1] + " filename [pretty]");
var filename = process.argv[2];
var pretty = (process.argv[3] && process.argv[3] == "pretty" ? true : false);
var outputDirectory = path.dirname(filename) || __dirname;
Moved to https://github.com/weberwithoneb/reddit-random-number-bot/
@webercoder
webercoder / mtg-resize.sh
Last active January 10, 2016 04:04
Takes MTG CCGHQ XLHQ images, strips the border, and adds a border size of your chosing. Tested with only the unglued basics.
#!/bin/bash
if [ "$#" -lt 1 ]; then
echo "Illegal number of parameters"
echo "Usage: $0 directory [border-size]"
exit
fi
if [ ! -z $2 ]; then
border=$2
else
border=65
@webercoder
webercoder / copy-iphone-photos.go
Created January 3, 2017 05:29
Recursively find iPhone photos in a directory and copy them to another
package main
import (
"fmt"
"io"
"os"
"os/exec"
"path/filepath"
"strconv"
"strings"