Skip to content

Instantly share code, notes, and snippets.

View johnmichel's full-sized avatar
👻
☕️

John Michel johnmichel

👻
☕️
View GitHub Profile
(function ($) {
$.event.special.textchange = {
setup: function (data, namespaces) {
$(this).bind('keyup', $.event.special.textchange.handler);
$(this).bind('cut paste input', $.event.special.textchange.delayedHandler);
},
teardown: function (namespaces) {
@johnmichel
johnmichel / nasty_for.js
Created June 25, 2010 03:42
A different approach to for loops
var i = -1, n = map.length;
// loop through each of the entries within map
for(i; ++i < n;) { /* do something */ }
@johnmichel
johnmichel / removeZeroes.js
Created July 21, 2010 17:38
Removes any leading zeroes from a string
// removes leading zeroes from a string
function removeZeroes(str) {
var zeroPattern = /^[0]*/;
return str.replace(zeroPattern,'');
}
@johnmichel
johnmichel / jaibreakme.com.js
Created August 2, 2010 12:30
The brains behind jailbreakme.com
/* via www.jailbreakme.com
pdfs available at http://www.jailbreakme.com/_/
*/
var agent = navigator.userAgent;
var index = agent.indexOf("OS ");
function goto_faq() {
if (!String(window.location).match(/faq/)) {
window.location = "faq.html"
@johnmichel
johnmichel / logThis.js
Created September 2, 2010 19:38
Simplifying console.log() calls
/* usage: logThis('pixel[0]',pixel[0]); */
function logThis(name,str) {
console.log(name+': ' + str);
}
#!/usr/bin/ruby -w
require 'rubygems'
require 'net/http'
require 'rexml/document'
include REXML
API_KEY = 'KEY GOES HERE'
LASTFM_USER = 'USERNAME GOES HERE'
@johnmichel
johnmichel / states_select.html
Created December 6, 2010 15:22
HTML code for US states
<select name="states">
<option value="" selected="selected">Select a State</option>
<option value="AL">Alabama</option>
<option value="AK">Alaska</option>
<option value="AZ">Arizona</option>
<option value="AR">Arkansas</option>
<option value="CA">California</option>
<option value="CO">Colorado</option>
<option value="CT">Connecticut</option>
<option value="DE">Delaware</option>
@johnmichel
johnmichel / kod_updater.scpt
Created January 19, 2011 19:12
AppleScript for updating to the latest daily build of Kod.
--Kod.app Daily Updater
--Author: John Michel
--Email: john.michel@gmail.com
--http://www.cowbird.org
--Version 0.1
--set local directory info
set remFile to "Kod.zip"
set locDir to "~/"
set locFile to "Kod.zip"
@johnmichel
johnmichel / LICENSE.txt
Created June 6, 2011 14:07 — forked from fgnass/LICENSE.txt
display a loading spinner
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Felix Gnass <https://github.com/fgnass>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@johnmichel
johnmichel / index.html
Created July 19, 2012 02:33
A web page created at CodePen.io
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Breaking Bad &middot; CodePen</title>
<!--
Copyright (c) 2012 John Michel, http://codepen.io/johnmichel
Permission is hereby granted, free of charge, to any person obtaining