🏳️⚧️
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| - 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'mongo_mapper' | |
| require 'yaml' | |
| MongoMapper.database = 'tmp' | |
| class Foo | |
| include MongoMapper::Document | |
| key :name, String | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # encoding: utf-8 | |
| $LOAD_PATH.unshift File.dirname(__FILE__) + '/vendor/mongo_mapper/lib' | |
| require 'rubygems' | |
| require 'mongo_mapper' | |
| require 'sunspot' | |
| require 'chronic' | |
| require 'logger' | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'logger' | |
| require 'mongo_mapper' | |
| MongoMapper.database = 'tmp' | |
| class Foo | |
| include MongoMapper::Document | |
| key :id, Integer | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'logger' | |
| log = Logger.new('clock.log') | |
| i = 0 | |
| loop do | |
| puts i | |
| log.info "#{i+=1}" | |
| sleep 1 | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
OlderNewer