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
require 'rubygems' | |
require 'preforker' | |
require 'eventmachine' | |
class EchoServer < EM::Connection | |
def notify_readable | |
while socket = @io.accept_nonblock | |
message = socket.gets | |
socket.write message | |
socket.close |
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
# cd into matching gem directory ("cd -" friendly) | |
cdgem() { | |
local gempath=$(gem env gemdir)/gems | |
if [[ $1 == "" ]]; then | |
cd $gempath | |
return | |
fi | |
local gem=$(ls $gempath | g $1 | sort | tail -1) | |
if [[ $gem != "" ]]; then |
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
class Object | |
def send(*args, &block) | |
"no soy sarasa porque me piso el send" | |
end | |
def sarasa | |
"soy sarasa" | |
end | |
end |
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
#!/usr/bin/env ruby | |
require 'benchmark' | |
Benchmark.bm do|b| | |
b.report("block") do | |
(1..1000000).map {|n| Math.log(n) } | |
end | |
b.report("to_proc") do | |
(1..1000000).map &Math.method(:log) |
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
require 'state_pattern' | |
class Stop < StatePattern::State | |
def next | |
sleep 3 | |
transition_to(Go) | |
end | |
def color | |
"Red" |
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
#sugared | |
do -> | |
class Animal | |
constructor: (@name) -> | |
move: (meters) -> | |
alert @name + " moved #{meters}m." | |
class Snake extends Animal | |
move: -> |
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
Quien es tu cliente? | |
Desarrolladores | |
Cual es tu propuesta de valor? | |
Facilitar la comunicación browser-servidor en tiempo real | |
Cuales son tus fuentes de ingresos? | |
Cual es tu estructura de costos? |
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
Quien es tu cliente? | |
Desarrolladores/Web shops | |
Cual es tu propuesta de valor? | |
Facilitar la comunicación browser-servidor en tiempo real | |
Ofrecer tecnologia para procesar datos en tiempo real y presentarlos al instante al usuario. | |
Cuales son tus fuentes de ingresos? | |
SaaS Software as a Service |
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
package main | |
type IChild interface { | |
Describe() | |
PrintName() | |
} | |
type Base struct { child IChild } | |
func (b *Base)Describe(){ | |
println("I'm a child of Base") |
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
# I have this AR model that has two scopes that should return complementary sets | |
# of rows: one returns all the rows that match certain conditions, the other | |
# returns all rows that DON'T match the same conditions. | |
# | |
# I would like to build the second scope using the first one. Something like: | |
# | |
# class Article | |
# def self.problematic | |
# not(complete) | |
# end |