Skip to content

Instantly share code, notes, and snippets.

View horacio's full-sized avatar
🧩

Horacio Bertorello horacio

🧩
  • Buenos Aires, Argentina
  • 13:36 (UTC -03:00)
View GitHub Profile
@jchris
jchris / detuned-wavepot-verge.js
Created June 17, 2014 19:07
changed some ints to floats.
/*!
*
* stagas - on the verge (tech mix)
*
*/
var bpm = 125;
var tuning = 440;
var transpose = 12;
DateNameNetworkPlacepingdown mbpsup mbps
22/11/2013Cafe DaltonBuenos Aires183.040.51
23/11/2013Cam24Buenos Aires521.570.49
25/11/2013Alpina SkateBuenos Aires204.941.15
26/11/2013Recoletta HostelBuenos Aires160.950.25
30/11/2013Alvear HostelSSCCordoba294.043.85
01/12/2013SorocabanaCordoba355.522.92
02/12/2013La MoraCordoba319.781.16
02/12/2013LapanaTendaCordoba544.031.15
08/12/2013Alvear HostelFiberte
module Enumerable
def each_with_emptiness
return to_enum(__callee__) unless block_given?
if empty?
yield nil, true
else
each do |element|
yield element, false
end
@pengwynn
pengwynn / backslash.rb
Created January 9, 2015 01:06
Where I prefer \ to parens in Ruby
hash.update \
:name => profile.name,
:company => profile.company,
:blog => profile.blog,
:location => profile.location,
:email => profile.email,
:hireable => profile.hireable,
...
@sandosh
sandosh / gist:959969
Created May 6, 2011 23:06
Underscore.js - compact an object just like compact function for array
_.mixin({
capitalize : function(string) {
return string.charAt(0).toUpperCase() + string.substring(1).toLowerCase();
},
compactObject: function(to_clean) {
_.map(to_clean, function(value, key, to_clean) {
if (_.isNull(value) || _.isUndefined(value) || (_.isString(value) && _.trim(value).length === 0) || (_.isBoolean(value) && value === false)) {
delete to_clean[key];
}
});
@guilleiguaran
guilleiguaran / active_model_compliant.rb
Created July 21, 2011 06:06
Ohm::ActiveModelCompliant, allows to Ohm (Redis OHM) to be partially compliant with ActiveModel (except errors)
require 'active_model'
module Ohm
module ActiveModelCompliant
def self.included(base)
base.send(:extend, ActiveModel::Naming)
base.send(:include, ActiveModel::Conversion)
base.send(:include, InstanceMethods)
end
@mperham
mperham / ex1.rb
Created April 19, 2011 02:43
Simple ping/pong with Actors
require 'actor'
# Execute with Rubinius: rbx ex1.rb
def error_loop(&block)
loop(&block)
rescue Exception => ex
puts ex.message
puts ex.backtrace.join("\n")
end
@woloski
woloski / eng.md
Last active March 29, 2017 18:25
We want to grow our small team at Auth0!

Senior Software Engineers

Remote required

Auth0 is a privately-held tech company based in Seattle, WA. We have a distributed team working remotely from Seattle, Buenos Aires and Cordoba.

We're building the company we always wanted, with people who share the same passion for technology, solutions and customers.

@rtomayko
rtomayko / Tests Is Wrong
Created January 28, 2009 20:50
Why "require 'rubygems'" In Your Library/App/Tests Is Wrong
In response to all the responses to:
http://twitter.com/rtomayko/status/1155906157
You should never do this in a source file included with your library,
app, or tests:
require 'rubygems'
The system I use to manage my $LOAD_PATH is not your library/app/tests
;; this file is a walkthrough of Moustache features, a web framework for Clojure
;; http://github.com/cgrand/moustache/tree/master
;; Moustache allows to declare routes, apply middlewares and dispatch on http methods.
;; Moustache is compatible with all frameworks built on Ring, including Compojure
(ns demo
(:use net.cgrand.moustache)
(:use [ring.adapter.jetty :only [run-jetty]])) ;; hmmm Ring without servlets