Skip to content

Instantly share code, notes, and snippets.

View joseluistorres's full-sized avatar
🤠
Como te ves me vi, como me veo te verás...

JoséLuis Torres joseluistorres

🤠
Como te ves me vi, como me veo te verás...
View GitHub Profile
@joseluistorres
joseluistorres / gist:5743586
Created June 9, 2013 13:41
RubyGDL Reunión Mensual Junio 13, 2013
require 'rubygdl'
require 'hackergarage'
require 'more/people'
describe RubyGDL::ReunionMensual do
it 'should be at 7pm CDT in HG'
Me.goTo(HackerGarage.place).onTime.should be_true
@joseluistorres
joseluistorres / gist:5810744
Created June 19, 2013 00:25
HIDE YOUR SINS
def get_campaign_language(language)
begin
languages = []
if language
@campaign.languages << Language.find_by_lang_code(language)
languages << language
end
return languages
rescue StandardError => e
puts e #HIDEYOURSINS
@joseluistorres
joseluistorres / RemoveMe
Created July 31, 2013 13:54
Scary Code
def restore_record
if params[:model] && params[:id]
begin
const_class = params[:model].upcase
a_record = const_class.constantize.send("only_deleted").send('find',params[:id])
a_record.recover
rescue Exception => e
logger.info "Restore error:#{e}"
end
end
@joseluistorres
joseluistorres / my_bob.rb
Created August 6, 2013 03:57
First Bob version
module StringValidations
def contains_hyphens_and_period_at_end?(str)
str.match(/\-|\.$/)
end
def contains_uppercase_words?(str)
str.match(/[A-Z]{2,}/)
end
@joseluistorres
joseluistorres / rubyagostothor
Last active December 20, 2015 20:28
Resuelve el acertijo de @hackergil
#! /usr/bin/env ruby
require 'thor'
class Test < Thor
desc "create", "Creates an empty git repository"
def create(dirname)
puts "Creating git repository"
FileUtils.mkdir dirname

Bearded's Hourly Contract

Date: [[Date of Document]] Between [Our Company] and [Your Company]

Summary

We’re not big on formality, but sometimes it’s best to have a few simple things written down so that we’re all on the same page. In this contract you won’t find complicated legal terms or large passages of unreadable text. We have no desire to trick you into signing something that you might later regret. We do want what’s best for the safety of both parties, now and in the future.

@joseluistorres
joseluistorres / rubysept2013.mkd
Last active December 22, 2015 11:29
RubyGDL Sept2013

Este 12 de Septiembre acompañanos en nuestra reunión mensual @ruby_gdl

Presentando a:

Refinery CMS Engines - Jason Stafford ![Alt text](/Users/supinchecompilla/Desktop/Screen Shot 2013-09-06 at 11.14.33 AM.png) Ember.js - Manuel Vidaurre @mvidaurre

Lessons learned in product development - Jaime Romero @jaimesromero

@joseluistorres
joseluistorres / ejemplo.rb
Last active December 23, 2015 03:49
Ejemplo Single Responsibility
class Hurricane
def initialize(latitud, longitud, lluvia, marejadas)
@latitud = latitud
@longitu = longitud
@lluvia = lluvia
@marejadas = marejadas
end
def afectar_localidad(latitud, longitud)
@latitud = latitud
@joseluistorres
joseluistorres / dependencias.rb
Created September 17, 2013 16:30
Administrando dependencias
class Lluvia
def initialize(intensidad)
@intensidad = intensidad
end
def empieza_lluvia
puts "=============LLUVIA==========="
end
end
@joseluistorres
joseluistorres / dependencias_fixed.rb
Created September 17, 2013 16:46
Dependencias fixed
class Lluvia
def initialize(intensidad, granizo)
@intensidad = intensidad
@granizo = granizo
end
def empieza_lluvia
puts "=============LLUVIA=#{@intensidad}=========="
end
end