This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import {Model} from 'react-vr'; | |
function getFormat(formats, format) { | |
for (let i = 0; i < formats.length; i++) { | |
if (formats[i].formatType === format) { | |
return formats[i]; | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!(function(){ | |
var original = console; | |
Object.defineProperty(window, 'console', { | |
get:function(){ | |
return original; | |
}, | |
set:function(value){ | |
original.log(value) | |
} | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var braces = '{()[()]}'; | |
// var braces = '{()()]}'; | |
// var braces = '('; | |
(function matchingBraces() { | |
if (braces.length === 1) return console.log(false); | |
if (!braces) return console.log(true); | |
var leftBraces = ['{', '(', '[']; | |
var rightBraces = ['}', ')', ']']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Extend the Underscore object with the following methods */ | |
// Rate limit ensures a function is never called more than every [rate]ms | |
// Unlike underscore's _.throttle function, function calls are queued so that | |
// requests are never lost and simply deferred until some other time | |
// | |
// Parameters | |
// * func - function to rate limit | |
// * rate - minimum time to wait between function calls | |
// * async - if async is true, we won't wait (rate) for the function to complete before queueing the next request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://npmjs.org/install.sh | sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**********************************************/ | |
/* | |
/* IR_Black Skin by Ben Truyman - 2011 | |
/* | |
/* Based on Todd Werth's IR_Black: | |
/* http://blog.toddwerth.com/entries/2 | |
/* | |
/* Inspired by Darcy Clarke's blog post: | |
/* http://darcyclarke.me/design/skin-your-chrome-inspector/ | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var sys = require('util'); | |
var oauth = require('oauth'); | |
var app = express.createServer(); | |
var _twitterConsumerKey = process.env['TWITTER_CONSUMER_KEY']; | |
var _twitterConsumerSecret = process.env['TWITTER_CONSUMER_SECRET']; | |
console.log("_twitterConsumerKey: %s and _twitterConsumerSecret %s", process.env['TWITTER_CONSUMER_KEY'], process.env['TWITTER_CONSUMER_SECRET']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* curl -o ~/Library/Application\ Support/Google/Chrome/Default/User\ StyleSheets/Custom.css https://raw.github.com/gist/1317519/435c54845a4303a6e252c3c43ea72324b9f6d1b1/Custom.css */ | |
/**********************************************/ | |
/* | |
/* Solarized Dark Skin by Mark Osborne - 2011 | |
/* | |
/* Based on IR_Black Skin by Ben Truyman: | |
/* https://gist.github.com/1245727 | |
/* | |
/* and Todd Werth's IR_Black: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**********************************************/ | |
/* curl -o ~/Library/Application\ Support/Google/Chrome/Default/User\ StyleSheets/Custom.css https://raw.github.com/gist/1163300/afecfb4f9c7ac1e26ec64710b1ccf87e30b47704/Custom.css | |
/* Tomorrow Skin by Ben Truyman - 2011 | |
/* | |
/* Based on Chris Kempson's Tomorrow Theme: | |
/* https://github.com/ChrisKempson/Tomorrow-Theme | |
/* | |
/* Inspired by Darcy Clarke's blog post: | |
/* http://darcyclarke.me/design/skin-your-chrome-inspector/ | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pubsub = { | |
sendMessage: function() { | |
message = $("input").val(); | |
$("body").trigger("messageReceived", { message: message}); | |
return false; | |
}, | |
displayMessage: function(data) { | |
$("body").trigger("messageDisplayed"); | |
li = $("<li />").text(data.message).css("display", "none"); | |
$("ul").append(li); |
NewerOlder