Skip to content

Instantly share code, notes, and snippets.

// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@cowboy
cowboy / ba-issemver.js
Created September 5, 2010 18:37
isSemVer - semantic version comparison for JavaScript
/*!
* isSemVer - v0.1 - 9/05/2010
* http://benalman.com/
* http://semver.org/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
/* Edit this file to add your own functionality to Spaz */
/**
* Add some custom timeline filters
*
* There are five timeline filter objects:
* - Spaz.TimelineFilters.friends
* - Spaz.TimelineFilters['public']
* - Spaz.TimelineFilters.lists
* - Spaz.TimelineFilters.search
// HOWTO: load LABjs itself dynamically!
// inline this code in your page to load LABjs itself dynamically, if you're so inclined.
(function (global, oDOC, handler) {
var head = oDOC.head || oDOC.getElementsByTagName("head");
function LABjsLoaded() {
// do cool stuff with $LAB here
}
@tvandervossen
tvandervossen / .kick
Created October 12, 2010 20:18
Reload browser on save Kicker recipe
process do |files|
execute("osascript -e 'tell application \"WebKit\"
do JavaScript \"window.location.reload()\" in first document
end tell'")
end
@rondevera
rondevera / hubb.sh
Created October 19, 2010 19:45
OS X: Opens the specified file/directory in GitHub via your browser
# Usage from within a Git repo:
#
# hubb public/javascripts/app.js
# # Opens `https://github.com/<repo>/blob/<branch>/public/javascripts/app.js`
# # in your browser.
#
# hubb
# # Opens `https://github.com/<repo>` in your browser.
hubb(){
repo=$(git config remote.origin.url | sed "s/^git@github\.com:\(.*\)\.git$/\1/")
# Tips for jQuery Bug Patching
# There are some assumptions made here, one being that you're
# set up with some form of "localhost" http server and that it's running.
# - http://www.mamp.info/en/mamp/
# - sudo apt-get install apache2
# Get it running:
# On Mac:
@getify
getify / queue.LAB.js
Created November 17, 2010 22:20
adding "queueing" to LABjs dynamically, to be able to simulate the $LAB chain dynamically with a for-loop
<!DOCTYPE html>
<html>
<head>
<title>LABjs Demo</title>
<script src="/js/queue.LAB.js"></script>
<script>
// adding `false` in the queue will signifiy an empty .wait() in the $LAB chain
$LAB.queue("http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js", false);
$LAB.queue("http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.min.js", false);
@chrismytton
chrismytton / license
Created January 5, 2011 21:42 — forked from defunkt/license
#!/bin/sh
# Usage: license
# Prints an MIT license appropriate for totin' around.
#
# $ license > MIT-LICENSE
set -e
echo "Copyright (c) `date +%Y` `git config --global user.name`"
echo '
Permission is hereby granted, free of charge, to any person obtaining
@bebraw
bebraw / gameengines.md
Created January 6, 2011 18:07
List of JS game engines. You can find a wikified version at https://github.com/bebraw/jswiki/wiki/Game-Engines. Feel free to modify that. I sync it here every once in a while.

IMPORTANT! Remember to check out the wiki page at https://github.com/bebraw/jswiki/wiki/Game-Engines for the most up to date version. There's also a "notes" column in the table but it simply does not fit there... Check out the raw version to see it.

This table contains primarily HTML5 based game engines and frameworks. You might also want to check out the [[Feature Matrix|Game-Engine-Feature-Matrix]], [[Game Resources]] and [[Scene Graphs]].

Name Size (KB) License Type Unit Tests Docs Repository Notes
Akihabara 453 GPL2, MIT Classic Repro no API github Intended for making classic arcade-style games in JS+HTML5
AllBinary Platform Platform Dependent AllBinary 2D/2.5D/3D n