Skip to content

Instantly share code, notes, and snippets.

View Neurogami's full-sized avatar

Neurogami Neurogami

View GitHub Profile
#!/usr/local/bin/ruby
require 'yaml'
require 'pp'
yaml = %~---
db_drive:
local_drive: "F:"
shared_drive: "F:"
db_names:
Going through the Lisperati haskell tutorial (http://www.lisperati.com/haskell/ht1.html)
There is one page that has me stumped: http://www.lisperati.com/haskell/ht6.html
In particular, this line:
where clip g = concatMap ((uncurry $ clipTriangle i).(partition g)) t
Here's what I think is happening, from assorted Googling:
A ruby WTF ...
*****************************************************************
UPDATE: See http://redmine.ruby-lang.org/issues/show/1735#note-2
A bug in an optimization setting does this.
*****************************************************************
irb(main):003:0* x = 0.05
/home/james/.rvm/gems/ruby-1.8.7-p249/gems/yard-0.5.5/lib/yard/handlers/ruby/legacy/class_condition_handler.rb:46:in `parse_condition': (eval):1:in `parse_condition': compile error (SyntaxError)
(eval):1: syntax error, unexpected ')', expecting $end
defined? ::Encoding) and String.method_defined?(:force_encoding
^
from /home/james/.rvm/gems/ruby-1.8.7-p249/gems/yard-0.5.5/lib/yard/handlers/ruby/legacy/class_condition_handler.rb:6:in `process'
from /home/james/.rvm/gems/ruby-1.8.7-p249/gems/yard-0.5.5/lib/yard/handlers/processor.rb:71:in `process'
from /home/james/.rvm/gems/ruby-1.8.7-p249/gems/yard-0.5.5/lib/yard/handlers/processor.rb:69:in `each'
from /home/james/.rvm/gems/ruby-1.8.7-p249/gems/yard-0.5.5/lib/yard/handlers/processor.rb:69:in `process'
from /home/james/.rvm/gems/ruby-1.8.7-p249/gems/yard-0.5.5/lib/yard/handlers/processor.rb:73:in `each_with_index'
[error]: Exception occurred while generating 'OpenSSL/PKey/DH.html'
[error]: Exception occurred while generating 'OpenSSL/PKey/EC.html'
[error]: Exception occurred while generating 'OpenSSL/PKey/EC/Group.html'
[error]: Exception occurred while generating 'OpenSSL/PKey/EC/Point.html'
[error]: Exception occurred while generating 'OpenSSL/PKey/DSA.html'
[error]: Exception occurred while generating 'OpenSSL/PKey/RSA.html'
[error]: Exception occurred while generating 'OpenSSL/SSL/Session.html'
@Neurogami
Neurogami / gist:1260642
Created October 4, 2011 00:40
apache benchmark ruby-doc.org/
ab -n500 -c10 http://www.ruby-doc.org/
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 www.ruby-doc.org (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
@Neurogami
Neurogami / yard 0.7.2 output.txt
Created October 4, 2011 23:38
yard 0.7.2 against 1.9.3 source code, running on ruby 1.9.2p312
james@james11:~/data/vhosts/ruby-doc-regen-tools/ruby_source/ruby_1_9_3$ yardoc -o ydocumentation .
[warn]: Cannot parse `lib/mkmf.rb': bad value for range
[warn]: Cannot parse `lib/rdoc.rb': bad value for range
[warn]: Cannot parse `lib/rss/0.9.rb': bad value for range
[warn]: Cannot parse `lib/rss/2.0.rb': bad value for range
[warn]: in YARD::Handlers::Ruby::MethodHandler: Undocumentable method defined on object instance
[warn]: in file 'sample/test.rb':1953:
1953: def foo.test
@Neurogami
Neurogami / gist:4351053
Last active December 10, 2015 00:28
require gist take 2
def machine_name
`hostname`
end
puts machine_name
require 'open-uri'
def require_gist2 raw_id
uri = "https://gist.github.com/raw/#{raw_id}/gistfile1.txt"
result = open(uri, "UserAgent" => "ruby::require_gist").read
eval result
end
gid = '4351053/a9feffd0835737b938ba4d1c7a0b3bd0248d3c15'
@Neurogami
Neurogami / gist:4964947
Created February 16, 2013 01:07
code for article about Leap Motion and JRuby
require "java"
$:.unshift "#{ENV['LEAP_SDK_HOME']}/lib/"
require 'LeapJava.jar'
import java.io.IOException
import java.lang.Math
module LeapMotion