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