Skip to content

Instantly share code, notes, and snippets.

View GusGA's full-sized avatar
🕶️
Reading someone else's code

Gustavo Giménez GusGA

🕶️
Reading someone else's code
  • Santiago, Chile
View GitHub Profile
[18:00:21] - naamio.fi.eu.synirc.net Message of the Day -
[18:00:21] - 24/10/2012 20:26
[18:00:21] -
[18:00:21] - ....... .
[18:00:21] - ......?NMMNMMMMMMNMMMD,. .
[18:00:21] - .. :MMMMMMMMMMMMMMMMMMMMMMMM$...
[18:00:21] - ....NMMMMMMMMMMMMMMMMMMMMMMMMMMMMN=. .
[18:00:21] - ..:NMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM$ ,
[18:00:21] - . MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM~.
[18:00:21] - ..DNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMN..
@mrmarcondes
mrmarcondes / Homework_2.2.rb
Last active October 12, 2015 11:08
10gen: M101 MongoDB for Developers - Homework 2.2
#ruby
client = Mongo::Client.new([ '127.0.0.1:27017' ], :database => 'm101')
grades = client[:grades].find("type" => "homework").sort({student_id:1, score:1})
student_id = nil
grades.each do |grade|
if student_id != grade["student_id"]
student_id = grade["student_id"]
client[:grades].find(_id: grade[:_id]).delete_one
end
@GusGA
GusGA / Receta.md
Last active October 13, 2015 19:58
Receta de Bruschettas a Lo Gonzo

#Receta para la preparación rápida de Bruschettas a lo gonzo

##Ingredientes

  • Pan Campesino
  • Tomate
  • Tocineta
  • Ajo
  • Perejil
  • Aceite de Oliva
@thinkclay
thinkclay / gist:5433225
Created April 22, 2013 08:18
MongoDB M101 HW 3.1 in Ruby
require 'mongo'
require 'json'
include Mongo
@client = MongoClient.new('localhost', 27017)
@db = @client['school']
@students = @db['students']
@students.find().each { |student|
# initialize data
name = 'Pavel Nikitin'
start_working_with_ruby = 2008
timeLoad = 'fulltime'
technologies = ['Rails', 'MySQL', 'Cassandra', 'HTML', 'CSS']
personal = ['talented', 'creative', 'team player']
contacts = {:email => 'daddybutcher@gmail.com', :skype => 'pavel.butcher.nikitin', :blog => 'http://itstickers.blogspot.com', :linkedin => 'http://www.linkedin.com/pub/pavel-nikitin/16/327/363'}
# build CV
cv = <<CV
@GusGA
GusGA / javascript_function_builders.md
Last active December 19, 2015 10:59
3 ways to declare a function in javascript

###Using Function constructor

    var sum = new Function('a','b', 'return a + b;');
    alert(sum(10, 20)); //alerts 30

###Using Function declaration.

    function sum(a, b) 
 {
@t0d0r
t0d0r / gist:6051774
Created July 22, 2013 06:52
hosts2ip.rb
#!/usr/bin/env ruby
# encoding: utf-8
# simple script to extract IP addresses for specific sites
# http://www.dkh.minfin.bg/bg/pubs/4/546
require 'socket'
hosts = <<__EOF__
www.bet365.com
@ameboide
ameboide / .bashrc
Created December 18, 2015 20:27
para hacer hotfixes y releases con `hotfix` y `release` y no olvidarse de la version y el changelog
#log de commits locales que no se han pusheado
alias gl='git log --branches --not --remotes --decorate'
alias gs='git status'
alias gf='git fetch origin'
alias gd='git difftool --tool=meld -d HEAD &'
alias ga='git add -u .;git add .'
alias gb='git branch -a'
gr(){
git reset $*
@betacar
betacar / elefantes.rb
Last active December 21, 2015 20:39 — forked from GusGA/elefantes.rb
i = 1
loop {
if i == 1
p "1 elefante se balanceaba sobre la tela de una araña, como veia que resistía fue a llamar a otro elefante"
else
p "#{i} elefantes se balanceaban sobre la tela de una araña, como veian que resistía fueron a llamar a otro elefante"
end
i += 1
sleep 5
}
@RainMonster
RainMonster / rails_routes_guide.md
Last active December 23, 2015 07:49
Short introduction to routes in Rails.

###Comparison of route breakdown between Sinatra and Rails: ###

in Sinatra routes were written like this:

    get '/' do
      #some Ruby code
      erb :index
    end

This is taken apart in Rails. The first line now resides in config/routes.rb and is decoupled from the Ruby code (now in controllers) and the view.