Skip to content

Instantly share code, notes, and snippets.

View rkh's full-sized avatar
👀
heeeyyyy

Konstantin Haase rkh

👀
heeeyyyy
View GitHub Profile
22/41] TestStringScanner#test_pos_unicode../../test/strscan/test_stringscanner.rb:208: [BUG] Segmentation fault
ruby 2.1.0dev (2013-04-20 trunk 40392) [x86_64-darwin12.3.0]
-- Crash Report log information --------------------------------------------
See Crash Report log file under the one of following:
* ~/Library/Logs/CrashReporter
* /Library/Logs/CrashReporter
* ~/Library/Logs/DiagnosticReports
* /Library/Logs/DiagnosticReports
the more detail of.
diff --git a/ext/strscan/strscan.c b/ext/strscan/strscan.c
index b81e1f1..2475ba5 100644
--- a/ext/strscan/strscan.c
+++ b/ext/strscan/strscan.c
@@ -38,6 +38,9 @@ struct strscanner
/* the regexp register; legal only when MATCHED_P(s) */
struct re_registers regs;
+
+ /* regexp used for last scan */
@rkh
rkh / build.sh
Last active December 16, 2015 02:29
#!/bin/bash -ex
[[ $RUBY ]] || (echo 'please set $RUBY' && exit 1)
rvm get stable
rvm reload
echo -n > $rvm_path/user/md5
echo -n > $rvm_path/user/sha512
rvm remove $RUBY
Rehearsal -----------------------------------------------------------
normal fib 0.170000 0.000000 0.170000 ( 0.173442)
keyword fib 0.000000 0.000000 0.000000 ( 0.000036)
keyword fib (optimized) 0.000000 0.000000 0.000000 ( 0.000013)
-------------------------------------------------- total: 0.170000sec
user system total real
normal fib 0.180000 0.000000 0.180000 ( 0.179575)
keyword fib 0.000000 0.000000 0.000000 ( 0.000026)
keyword fib (optimized) 0.000000 0.000000 0.000000 ( 0.000008)
# Running tests:
.........................................................E.................
Finished tests in 24.162502s, 3.1040 tests/s, 7.8220 assertions/s.
1) Error:
test_after_reply(TestRackServer):
IOError: stream closed
/Users/konstantin/Workspace/puma/lib/puma/server.rb:575:in `write'
@rkh
rkh / gist:4644647
Last active December 11, 2015 18:49

The Hunt for the right HTTP library

Use case: Travis CLI. One command invokes one or more sequential HTTP requests.

Note that startup time and the first request are very significant for a command line tool like this.

Clone the repo if you want to follow along.

Note: numbers might be due to how libraries are used (via faraday)

pager = ENV['PAGER'] # aka less
stdout = $stdout
IO.popen(pager, "w") do |f|
f.puts "Hello, this goes only to less!"
end
IO.popen(pager, "w") do |f|
puts "Hello, this goes only to stdout!"
end
require 'travis'
repos = Travis::Repository.find_all(owner_name: 'travis-ci')
repos.each { |repo| puts "#{repo.slug} #{repo.last_build_state}" }

Ancient City Ruby is a two-day single-track Ruby conference in America’s oldest city, St. Augustine, Florida.

“America” | Settlement | City | Continiously inhabited | European | European and still inhabited
America | Puerto Hormiga, 4000 BC | Caral, 2627 BC | Ticul, 700 BC* | Eystribyggð, 985 | Santo Domingo, 1498
North America | Kaminaljuyu, 1500 BC | Kaminaljuyu, 1500 BC | Ticul, 700 BC* | Eystribyggð, 985 | Santo Domingo, 1498
Mexico, USA & Canada | Ticul, 700 BC | Ticul, 700 BC | Ticul, 700 BC | L’Anse aux Meadows, 1003 | Veracruz, 1519
USA | Cahokia, 650 | Cahokia, 650 | Acoma Pueblo, 1000 | San Juan, 1521 | San Juan, 1521
USA continental | Cahokia, 650 | Cahokia, 650 | Acoma Pueblo, 1000 | Pensacola, 1559 | Pensacola, 1559

  • Kaminaljuyu is now part of Guatemala C
@rkh
rkh / index.js
Created December 17, 2012 19:30 — forked from aledbf/index.js
var program = require('commander'),
request = require('request'),
fs = require('fs'),
ursa = require('ursa');
program.on('--help', function() {
console.log(' Alternative to https://gist.github.com/fbb99b638e9da27fe24d (generate secure environment variables)');
console.log(' Example:');
console.log('');
console.log(' $ node index -r github-user/user-repo -v SECURE=value');