This file contains 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
1024 E 24 yotta Y | |
1021 E 21 zetta Z | |
1018 E 18 exa E | |
1015 E 15 peta P | |
1012 E 12 tera T | |
109 E 9 giga G | |
106 E 6 mega M | |
103 E 3 kilo k | |
102 E 2 hecto h | |
101 E 1 deca da |
This file contains 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
[hukl@nine ~/Desktop/erlang:master]$ erl | |
Erlang R14B04 (erts-5.8.5) [source] [64-bit] [smp:8:8] [rq:8] [async-threads:0] [hipe] [kernel-poll:false] | |
*** ERROR: Shell process terminated! *** | |
{error_logger,{{2011,11,28},{21,45,14}},"~s~n",["Error in process <0.23.0> with exit value: {{case_clause,{error,{{bad_object,eval_work_list},\"/Users/hukl/.erlang-hist.nonode@nohost\"}}},[{group_history,load,2},{group_history,load,2},{group,server,3}]}\n"]} | |
{error_logger,{{2011,11,28},{21,45,14}},"~s~n",["Error in process <0.24.0> with exit value: {{case_clause,{error,{{bad_object,eval_work_list},\"/Users/hukl/.erlang-hist.nonode@nohost\"}}},[{group_history,load,2},{group_history,load,2},{group,server,3}]}\n"]} | |
{error_logger,{{2011,11,28},{21,45,14}},supervisor_report,[{supervisor,{<0.21.0>,user_sup}},{errorContext,child_terminated},{reason,{{case_clause,{error,{{bad_object,eval_work_list},"/Users/hukl/.erlang-hist.nonode@nohost"}}},[{group_history,load,2},{group_history,load,2},{group,server,3}]}},{offender,[{pid,<0.23.0 |
This file contains 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(myjoin). | |
-export([join/1, join/2, start/0]). | |
start() -> | |
join( [{foo,"bar"},{baz,"bang"}] ). | |
join([H|T]) -> | |
{K,V} = H, | |
Acc = atom_to_list(K) ++ "=" ++ V, |
This file contains 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 'active_record' | |
# Print out what version we're running | |
puts "Active Record #{ActiveRecord::VERSION::STRING}" | |
# Connect to an in-memory sqlite3 database (more on this in a moment) | |
ActiveRecord::Base.establish_connection( | |
:adapter => 'sqlite3', | |
:database => ':memory:' |
This file contains 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 Order | |
has_many :order_tickets | |
has_many :tickets, :through => :order_tickets | |
end | |
class Ticket | |
has_many :order_tickets | |
has_many :orders, :through => :order_tickets | |
end |
This file contains 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
Timecop.travel( 10.minutes.ago ) do | |
# do some stuff in the past | |
end | |
# Return back to normal |
This file contains 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
git log --pretty=format:%H file | head -n1 |
This file contains 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
backend default { | |
.host = "production.s3.rubygems.org"; | |
.port = "80"; | |
} | |
sub vcl_recv { | |
set req.http.Host = "production.s3.rubygems.org"; | |
return(lookup); | |
} |
This file contains 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
payload << "=" until ( payload.length % 4 == 0 ) |
This file contains 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
curl -X DELETE localhost:9200/custom_analyzer_test | |
curl -X PUT localhost:9200/custom_analyzer_test -d ' | |
{ | |
"settings" : { | |
"index" : { | |
"number_of_shards" : 1, | |
"number_of_replicas" : 0, | |
"analysis" : { | |
"analyzer" : { | |
"url_analyzer" : { |