Skip to content

Instantly share code, notes, and snippets.

View leobalter's full-sized avatar
💭
status

Leo Balter leobalter

💭
status
View GitHub Profile
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) {
@leobalter
leobalter / asshole.js
Created May 30, 2011 04:48 — forked from Kilian/annoying.js
How to be an asshole
/**
* Annoying.js - How to be an asshole to your users
*
* DO NOT EVER, EVER USE THIS.
*
* Copyright (c) 2011 Kilian Valkhof (kilianvalkhof.com)
* Visit https://gist.github.com/767982 for more information and changelogs.
* Visit http://kilianvalkhof.com/2011/javascript/annoying-js-how-to-be-an-asshole/ for the introduction and weblog
* Check out https://gist.github.com/942745 if you want to annoy developer instead of visitors
*
var A = function(){};
A.prototype.foo = function(){
console.log('foo');
}
var B = function(){};
B.prototype.bar = function(){
console.log('bar');
@leobalter
leobalter / placeholder.js
Created June 16, 2011 17:58 — forked from RamonPage/placeholder.js
Check placeholder support.
function supports_input_placeholder() {
var input = document.createElement('input');
return 'placeholder' in input;
}
@leobalter
leobalter / array.goodies.js
Created July 10, 2011 01:38 — forked from rwaldron/array.extensions.md
Array goodies from twitter rap with David Herman, see wrap up here: http://twitter.com/#!/littlecalculist/status/89855977838485504
// http://twitter.com/#!/littlecalculist/status/89848378682392576
// http://twitter.com/#!/littlecalculist/status/89855977838485504
// Variable Arity Array.of()
Array.of = function() {
return [].slice.call( arguments );
};
console.log(
Array.of( "things", "that", "aren't", "currently", "an", "array" )
// From @littlecalculist
// http://twitter.com/#!/littlecalculist/status/89840539494662144
Function.prototype.build = function(a) {
return new (
this.bind.apply(this, [,].concat(a))
);
};
// Example constructor that "does things"
@leobalter
leobalter / ArrayExtender.js
Created July 15, 2011 03:33
Array Extender. Creates an Array subclass. Doing so you won't override or mess with Array's own prototype
var ArrayExtender = function (a) {
var counter = 0;
for (var i in a) {
if (a.hasOwnProperty(i)) {
this[i] = a[i];
++counter;
}
}
this.length = counter;
@leobalter
leobalter / MyObj.js
Created July 15, 2011 05:30
MyObj creation like jQuery is
(function(window, undefined) {
var MyObj = (function () {
var MyObj = function () {
return new MyObj.fn.init();
};
MyObj.fn = MyObj.prototype = {
init : function () {
return this;
@leobalter
leobalter / example.html
Created September 12, 2011 17:32
HorizontalMenu Example
<nav id="myMenu" class="menuHorizontal">
<ul>
<li class="currentActive">
<a href="#">Menu</a>
</li>
<li>
<a href="#">Leo Balter</a>
</li>
<li>
<a href="#">File</a>