Skip to content

Instantly share code, notes, and snippets.

Neurogami Neurogami

Block or report user

Report or block Neurogami

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:199453
#!/usr/local/bin/ruby
require 'yaml'
require 'pp'
yaml = %~---
db_drive:
local_drive: "F:"
shared_drive: "F:"
db_names:
View Understanding Haskell, part 0
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:
View gist:324902
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
View gist:434798
/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'
View gist:434822
[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 Oct 4, 2011
apache benchmark ruby-doc.org/
View gist:1260642
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 Oct 4, 2011
yard 0.7.2 against 1.9.3 source code, running on ruby 1.9.2p312
View yard 0.7.2 output.txt
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 Dec 10, 2015
require gist take 2
View gist:4351053
def machine_name
`hostname`
end
puts machine_name
View gist:4351072
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 Feb 16, 2013
code for article about Leap Motion and JRuby
View gist:4964947
require "java"
$:.unshift "#{ENV['LEAP_SDK_HOME']}/lib/"
require 'LeapJava.jar'
import java.io.IOException
import java.lang.Math
module LeapMotion
You can’t perform that action at this time.