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 / pixel67
Created May 25, 2012 13:23
zsh shell theme
function git_prompt_info() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX"
}
function get_pwd() {
print -D $PWD
}
function battery_charge() {
@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 / my Class
Created June 24, 2012 22:26
Just another faux class
// A Car 'class'
function Car1(model) {
this.model = model;
this.color = 'silver';
this.year = '2012';
this.getInfo = function() {
return this.model + ' '+ this.year + ' ' + this.color;
};
@anthonybrown
anthonybrown / Animal
Created June 25, 2012 22:43
more class emulation in js
<script type="text/javascript">
var Animal = function(){};
Animal.prototype.breath = function(){
console.log('inhale');
};
Animal.prototype.heart = function(){
console.log('beating heart');
};