#Receta para la preparación rápida de Bruschettas a lo gonzo
##Ingredientes
- Pan Campesino
- Tomate
- Tocineta
- Ajo
- Perejil
- Aceite de Oliva
[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.. |
#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 |
#Receta para la preparación rápida de Bruschettas a lo gonzo
##Ingredientes
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 |
###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)
{
#!/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 |
#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 $* |
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 | |
} |
###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.