Skip to content

Instantly share code, notes, and snippets.

View timuruski's full-sized avatar
🥊
Hit. Don't get hit.

Tim Uruski timuruski

🥊
Hit. Don't get hit.
View GitHub Profile
# Proof of concept
e = 2
c = 10**e
amt = 5.67
amt_i = (amt * c).to_i
amt_f = amt_i.to_f / c
tax = 11
tax_f = tax.to_f / 100
def create_random_person
slug = $person_count.inc!
name = random_name
puts "Creating #{name} - #{slug}"
person = Person.create!( :slug => slug, :name => name, :TMP => true )
end
---
- score: 5.0090723
title: Buffy the Vampire Slayer
first_air_date: 1997-03-10 19:00:00 Z
last_air_date: 2001-05-15 18:00:00 Z
mid: 144z
external_ids:
thetvdb: "70327"
module Kernel
# Returns the object's singleton class.
def singleton_class
class << self
self
end
end unless respond_to?(:singleton_class) # exists in 1.9.2
end
require 'mongo_mapper'
require 'yaml'
MongoMapper.database = 'tmp'
class Foo
include MongoMapper::Document
key :name, String
end
# encoding: utf-8
$LOAD_PATH.unshift File.dirname(__FILE__) + '/vendor/mongo_mapper/lib'
require 'rubygems'
require 'mongo_mapper'
require 'sunspot'
require 'chronic'
require 'logger'
require 'logger'
forks = 4
a = 0
b = 400 # 649976
forks.times do |i|
Kernel.fork do
log = Logger.new("/Users/#{`whoami`.strip}/tmp/log-#{i}.log")
count = (b-a) / forks
require 'logger'
require 'mongo_mapper'
MongoMapper.database = 'tmp'
class Foo
include MongoMapper::Document
key :id, Integer
end
require 'logger'
log = Logger.new('clock.log')
i = 0
loop do
puts i
log.info "#{i+=1}"
sleep 1
end
The Internet Movie Database consists of the following lists:
List | Maintained by | Updated
---------------------|-------------------------------------------|----------
Actors | Giancarlo Cairella http://imdb.com/contact| 24-06-05
Actresses | Giancarlo Cairella http://imdb.com/contact| 24-06-05
Alternative Names | Duncan Smith http://imdb.com/contact/ | 24-06-05
Alternative Titles | Michel Hafner http://imdb.com/contact/ | 17-06-05
Alternative Versions | Giancarlo Cairella http://imdb.com/contact| 17-06-05
Biographies | Geoff Leonard http://imdb.com/contact/ | 24-06-05