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
@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
@mrmarcondes
mrmarcondes / question2.js
Created December 11, 2012 21:05
10gen: M101 MongoDB for Developers - Final - question 2
db.messages.aggregate([
{$project: {"_id": 0,
"headers.From": 1,
"headers.To": 1
}},
{$unwind: "$headers.To"},
{$group: {
"_id": {from: "$headers.From",
to: "$headers.To"},
sum: {"$sum": 1}
@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
@rjsamson
rjsamson / Rakefile
Created May 27, 2013 01:50
Example Rubymotion menubar app
# -*- coding: utf-8 -*-
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project/template/osx'
Motion::Project::App.setup do |app|
# Use `rake config' to see complete project settings.
app.name = 'MenubarApp'
app.info_plist['NSUIElement'] = 1
end
@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
include Math;R1=1.0; R2=2.0;K2=5.0
SS=40;K1=SS*K2*3/(8*(R1+R2));def rf(a, b)
cosA=cos(a);sinA=sin(a);cosB=cos(b);sinB=sin(b)
o=Array.new(SS).fill{Array.new(SS).fill(' ')};b=Array.
new(SS).fill{ Array.new(SS).fill(0)}; t=0.0;while t<2*PI
cost=cos(t);sint=sin(t);p=0.0;while p<2*PI;cosp=cos(p);sinp=
sin(p);cx=R2+R1*cost;cy=R1* sint;x=cx*(cosB*cosp+sinA*
sinB*sinp)-cy*cosA*sinB; y=cx*(sinB*cosp-sinA*##
cosB*sinp)+cy*cosA*cosB ;z=K2+cosA*cx*sinp+cy*
sinA;ooz=1/z;xp=(SS/2+K1* ooz*x).to_i ;yp= (SS/2-
@whatsthebeef
whatsthebeef / world.json
Last active March 25, 2024 05:21
world.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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
}