Skip to content

Instantly share code, notes, and snippets.

View leobalter's full-sized avatar
💭
status

Leo Balter leobalter

💭
status
View GitHub Profile
QUnit.suite('jQuery Core', function (assert, test) {
test.beforeEach(function (assert) {
var env = this,
done = assert.async();
this.user = 'data';
setTimeout(function () {
env.foo = 'bar';

The idea is to have nginx installed and node installed. I will extend this gist to include how to install those as well, but at the moment, the following assumes you have nginx 0.7.62 and node 0.2.3 installed on a Linux distro (I used Ubuntu).

In a nutshell,

  1. nginx is used to serve static files (css, js, images, etc.)
  2. node serves all the "dynamic" stuff.

So for example, www.foo.com request comes and your css, js, and images get served thru nginx while everything else (the request for say index.html or "/") gets served through node.

  1. nginx listens on port 80.
$ d8 --help
SSE3=1 SSE4_1=1 SAHF=1 AVX=1 FMA3=1 ATOM=0
Usage:
shell [options] -e string
execute string in V8
shell [options] file1 file2 ... filek
run JavaScript scripts in file1, file2, ..., filek
shell [options]
shell [options] --shell [file1 file2 ... filek]
run an interactive JavaScript shell
[~/dev/bocoup/stitchfix.github.io] (bocoup)
$ aws --profile bocoup s3 cp _site/ s3://stitchfix.bocoup.com --recursive --include \'*\' --acl \'public-read\'
usage: aws [options] <command> <subcommand> [parameters]
aws: error: argument --acl: Invalid choice, valid choices are:
private | public-read
public-read-write | authenticated-read
bucket-owner-read | bucket-owner-full-control
log-delivery-write
@leobalter
leobalter / _css_dropdown_menu.markdown
Last active August 29, 2015 14:21 — forked from anonymous/index.html
CSS Dropdown Menu

CSS Dropdown Menu

('-' * 6)

A Pen by Leo Balter on CodePen.

License

Copyright (c) 2015 by Leonardo Balter
Temperature: { celsius: 85, fahrenheit: 185, kelvin: 358.15 }
Temperature: { celsius: 33, fahrenheit: 91.4, kelvin: 306.15 }
Temperature: { celsius: 82, fahrenheit: 179.6, kelvin: 355.15 }
Temperature: { celsius: 40, fahrenheit: 104, kelvin: 313.15 }
Temperature: { celsius: 70, fahrenheit: 158, kelvin: 343.15 }
Temperature: { celsius: 81, fahrenheit: 177.8, kelvin: 354.15 }
Temperature: { celsius: 33, fahrenheit: 91.4, kelvin: 306.15 }
Temperature: { celsius: 81, fahrenheit: 177.8, kelvin: 354.15 }
Temperature: { celsius: 40, fahrenheit: 104, kelvin: 313.15 }
Temperature: { celsius: 87, fahrenheit: 188.6, kelvin: 360.15 }
var five = require("johnny-five");
var board = new five.Board();
board.on("ready", function() {
var sensor = new five.Sensor({
pin: "A1",
freq: 100
});
var led = new five.Led(13);
var stored = 0;
2011-05-09T19:29:50-07:00 heroku[slugc]: Slug compilation started
2011-05-09T19:32:42-07:00 heroku[slugc]: Slug compilation started
2011-05-09T19:32:45-07:00 heroku[api]: Deploy 6bab9f5 by leonardo.balter@gmail.com
2011-05-09T19:32:45-07:00 heroku[api]: Release v4 created by leonardo.balter@gmail.com
2011-05-09T19:32:45-07:00 heroku[web.1]: State changed from created to starting
2011-05-09T19:32:45-07:00 heroku[slugc]: Slug compilation finished
2011-05-10T02:32:46+00:00 heroku[web.1]: Starting process with command: `thin -p 11621 -e production -R /home/heroku_rack/heroku.ru start`
2011-05-10T02:32:46+00:00 app[web.1]: /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- sinatra (LoadError)
2011-05-10T02:32:46+00:00 app[web.1]: from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
2011-05-10T02:32:46+00:00 app[web.1]: from ./app.rb:1
@leobalter
leobalter / escopoDeFor
Created May 26, 2011 23:28
Solução para o exemplo contido em http://jsfiddle.net/YLhrP/
// exemplo em: http://jsfiddle.net/YLhrP/
function init() {
var dummy = [ 123, 234, 345, 456, 567, 678, 789, 890 ],
newDiv;
for ( var i in dummy ) {
newDiv = jQuery('<div id="newDiv_'+i+'">Clique Aqui!</div>');
newDiv.bind('click', (function(valor_de_i) {
return function(ev) {
var A = function(){};
A.prototype.foo = function(){
console.log('foo');
}
var B = function(){};
B.prototype.bar = function(){
console.log('bar');