Skip to content

Instantly share code, notes, and snippets.

View webercoder's full-sized avatar
🌴

Mike Weber webercoder

🌴
  • Sydney, Australia
  • 00:09 (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 / wp-author-import-auto-select.js
Created June 4, 2012 20:33
Auto-select authors for posts during WordPress import. They must already be assigned to the project. Enable jQuery in a plugin or functions.php, and paste this in the browser console.
(function($){
$('#authors li').each(function(key, value) {
var name = $(this).children('strong').first().html();
var re = /\s\([^\)]+\)/gi;
name = name.replace(re, '');
$(this).find('select').first().children('option').each(function(){
if ($(this).html() == name) {
console.log('Comparing ' + $(this).html() + ' to ' + name + ".\n");
$(this).attr('selected', 'selected');
@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;
@webercoder
webercoder / index.html
Created August 7, 2013 07:49
A CodePen by Mike Weber. Social Icons with Font Awesome - Horizontal list with font-awesome icons.
<div class="container">
<div class="row">
<div class="span10 offset1">
<div class="social-icons">
<h1>Horizontal Social Icon List</h1>
<ul>
<li><a href="https://twitter.com"><i class="icon-twitter"></i></a></li>
<li><a href="https://facebook.com"><i class="icon-facebook"></i></a></li>
<li><a href="https://instagram.com"><i class="icon-instagram"></i></a></li>
<li><a href="https://pinterest.com"><i class="icon-pinterest"></i></a></li>
Moved to https://github.com/weberwithoneb/reddit-random-number-bot/