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 | |
#Script to explore chess opening lines based on most popular of google's top 100 results | |
#Usage: | |
#▸ ./goopening "1. e4 e5 2." | |
#1: nf3 (35) | |
#2: qh5 (7) | |
#3: bc4 (4) | |
#4: nc6 (2) |
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 'net/https' | |
require 'open-uri' | |
require 'tempfile' | |
# This script tries to detect a bug in which macosx doesn't raise an exception | |
# and executes the request despite knowing the host failed its ssl verification | |
# | |
# Run with ruby < <(curl -s https://raw.github.com/gist/3049397/checkbug.rb) | |
# Try it in linux and macosx. Linux behaves correctly. |
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 'net/https' | |
require 'open-uri' | |
require 'tmpdir' | |
unless ARGV[0] | |
puts "Usage: #{File.basename(__FILE__)} hostname [pemfile]" | |
puts "It will use http://curl.haxx.se/ca/cacert.pem if no pemfile is specified" | |
exit false |
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
#Which is the best alternative? A is clearer but is it slower? is there a better way? | |
#A: The block will be run in all examples, do_something_with will only be run when my_metadata defined | |
RSpec.configure do |config| | |
config.before(:each) do |example| | |
do_something_with(example.metadata[:my_metadata]) if example.metadata.has_key?(:my_metadata) | |
example.run | |
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 'rubygems' | |
require 'json' | |
require 'rankable_graph' | |
require 'net/http' | |
require 'mechanize' | |
require 'nokogiri' | |
def follower_usernames_of(user) |
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 |
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
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
#sugared | |
do -> | |
class Animal | |
constructor: (@name) -> | |
move: (meters) -> | |
alert @name + " moved #{meters}m." | |
class Snake extends Animal | |
move: -> |