Skip to content

Instantly share code, notes, and snippets.

View anthonybrown's full-sized avatar
🎯
Focusing

Tony Brown anthonybrown

🎯
Focusing
View GitHub Profile
@anthonybrown
anthonybrown / app.js
Created May 15, 2012 13:57 — forked from elranu/app.js
Socket.IO RedisStore and Rooms
//app.js Socket IO Test
var app = require('express').createServer(),
redis = require('socket.io/node_modules/redis'),
io = require('socket.io').listen(app);
var pub = redis.createClient(port, "url");
var sub = redis.createClient(port, "url");
var store = redis.createClient(port, "url");
pub.auth('pass', function(){console.log("adentro! pub")});
sub.auth('pass', function(){console.log("adentro! sub")});
@anthonybrown
anthonybrown / gist:2768866
Created May 22, 2012 12:53 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@anthonybrown
anthonybrown / editor.css
Created May 22, 2012 15:31 — forked from nakhli/editor.css
Backbone.js tutorial - Part 1 - www.javageneration.com
.shape{
height: 100%;
width: 100%;
}
.circle {
border-radius: 50%/50%;
-moz-border-radius: 50%/50%;
-webkit-border-radius: 50%/50%;
}
.hide {
@anthonybrown
anthonybrown / rAF.js
Created May 25, 2012 09:46 — forked from paulirish/rAF.js
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller
// fixes from Paul Irish and Tino Zijdel
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
@anthonybrown
anthonybrown / scoped.html
Created June 7, 2012 10:44 — forked from jugglinmike/scoped.html
Bocoup.com: Future of 3PJS
<div class="container">
<style scoped>
p { color: red; }
</style>
<p>This paragraph has red text.<p>
</div>
<p>This paragraph does not.</p>
@anthonybrown
anthonybrown / gist:2892884
Created June 8, 2012 01:36
HTML5 Canvas WebGL Plane with Three.js (simplified)
<script src="http://www.html5canvastutorials.com/libraries/Three.js"></script>
<script>
// RequestAnimationFrame shim
window.requestAnimFrame = ( function( callback ) {
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function ( callback ) {
@anthonybrown
anthonybrown / LICENSE.txt
Created June 18, 2012 12:51 — forked from sindresorhus/LICENSE.txt
Photo Booth (140byt.es)
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2012 Sindre Sorhus <http://sindresorhus.com>
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
@anthonybrown
anthonybrown / CHANGES.md
Created August 7, 2012 12:02 — forked from topfunky/CHANGES.md
Express 3.0 Changes

Changes in Express 3.0 Templates

Related: PeepCode Full Stack Node.js screencast (an included code sample works with Express 3.0).

There are several syntax changes in Express 3.0. They do require modifications to your code, but they aren't too complicated.

The biggest change is that Express templates now use Django style inheritance rather than ERB/Rails style automatic layouts.

Summary

@anthonybrown
anthonybrown / Railscast2.tmTheme
Created September 26, 2012 23:11 — forked from smlombardi/Railscast2.tmTheme
Modified version of Railscast theme for Textmate/Sublime Text 2
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Railscasts 2</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
@anthonybrown
anthonybrown / jquery.ba-tinypubsub.js
Created September 30, 2012 20:49 — forked from cowboy/HEY-YOU.md
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011
* http://benalman.com/
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */
(function($) {
var o = $({});
$.subscribe = function() {
o.on.apply(o, arguments);