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 'thor' | |
require 'thor/actions' | |
module DataMapper | |
module Gen | |
class CLI < Thor | |
include Thor::Actions | |
DM_VERSION = '1.0' |
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
% cumulative self self total | |
time seconds seconds calls ms/call ms/call name | |
------------------------------------------------------------ | |
10.98 277.26 104.33 30721151 0.00 0.01 Hash#find_entry | |
9.58 116.29 91.02 36303266 0.00 0.00 Hash::Entry#match? | |
9.51 141.50 90.35 29760101 0.00 0.00 String#<< | |
5.52 501.94 52.41 9920000 0.01 0.05 Hexdump::Dumper::print<330> {} | |
4.72 949.77 44.83 12 3735.59 79147.48 String#each_byte | |
4.70 345.50 44.70 9920000 0.00 0.03 Hexdump::Dumper::each<279> {} | |
4.18 321.67 39.69 30721093 0.00 0.01 Hash#[] |
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
$ ab -n 1000 http://localhost:8080/ | |
This is ApacheBench, Version 2.3 <$Revision: 655654 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking localhost (be patient) | |
Completed 100 requests | |
Completed 200 requests | |
Completed 300 requests | |
Completed 400 requests |
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 Mixin | |
def self.included(base) | |
base.module_eval do | |
def self.mixin(*modules,&block) | |
@mixin_modules = modules | |
@mixin_block = block | |
def self.included(base) | |
unless @mixin_modules.empty? | |
base.send(:include,*@mixin_modules) |
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 'pp' | |
invalids = ObjectSpace.each_object(DataMapper::Resource).select { |obj| !obj.saved? && !obj.valid? } | |
pp invalids.map { |obj| [obj.class, obj.errors.to_hash] } |
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
ccopy_reg | |
_reconstructor | |
p0 | |
(clib.core.datatype | |
injectionDict | |
p1 | |
c__builtin__ | |
dict | |
p2 | |
(dp3 |
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
class Command | |
def initialize(path,arguments,env={}) | |
@path = path | |
@arguments = arguments | |
@env = env | |
end | |
def to_ary | |
[@env, @path, @arguments] |
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
ruby-1.9.2-p180 :001 > require './require_benchmark.rb' | |
=> true | |
ruby-1.9.2-p180 :002 > require 'ronin' | |
=> true | |
ruby-1.9.2-p180 :003 > | |
0.00090616 tsort | |
0.001040251 enumerator | |
0.001549864 pathname | |
0.001783703 set | |
0.001899229 data_paths/data_paths |
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 'rubygems' | |
require 'rbtree' | |
class Req | |
attr_accessor :path, :time, :requires, :exception | |
def initialize(path) | |
@path = path | |
@requires = [] | |
@time = 0 | |
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
#!/usr/bin/env ruby | |
require 'net/http' | |
require 'json' | |
require 'date' | |
class PriorArt < Struct.new(:name,:description,:created_at,:updated_at) | |
end | |
prior_art = {} |