Skip to content

Instantly share code, notes, and snippets.

View mustmodify's full-sized avatar

Johnathon "jw" Wright mustmodify

View GitHub Profile
class TransformationPackage
def some_helper_that_i_want_in_scope
end
def analyze( data, methodology )
puts "Analyzing #{data.count} data: "
data.each do |datum|
instance_eval(&methodology, datum)
putc '.'
jw@logopolis:/projects/physioage/lexicon$ RBXOPT='-Xgc.show -Xjit.show' bin/rails c
[[[ JIT queued Array#include? (method) (4958) ]]]
[[[ JIT queued Comparable#== (method) (32000) ]]]
[[[ JIT finished background compiling Array#include? (method) ]]]
[[[ JIT finished background compiling Comparable#== (method) ]]]
[[[ JIT queued Array#each (method) (12802) ]]]
[[[ JIT queued Array#<< (method) (32000) ]]]
[[[ JIT finished background compiling Array#each (method) ]]]
[[[ JIT finished background compiling Array#<< (method) ]]]
[[[ JIT queued BasicObject#! (method) (32000) ]]]
Using rvm, install rbx 2.4.1
gem install rails ( which gives version 4.2.0 )
rails new abc
# it breaks
cp Gemfile abc/Gemfile
cd abc
bundle install
jw@logopolis:/projects/open/rubyspec$ mspec run .
rubinius 2.4.1 (2.1.0 b332f133 2014-12-04 3.4 JI) [x86_64-linux-gnu]
...FF.......An exception occurred evaluating command line code:
undefined method `e' on an instance of Object. (NoMethodError)
Backtrace:
@mustmodify
mustmodify / patch.rb
Created December 30, 2014 19:26
patching numeric with scale
class Numeric
attr_accessor :scale
# NOTE: Does not affect self
def to_scale(digits=2)
out = ((self.to_f * (10**digits)).round).to_f/(10**digits)
out.scale = digits
out.extend(Formatter)
end
@mustmodify
mustmodify / stack trace
Created December 31, 2014 17:44
fresh server, trying to `gem install bundler`
root@willow:~# gem install bundler
Fetching: bundler-1.7.10.gem (100%)
Successfully installed bundler-1.7.10
Parsing documentation for bundler-1.7.10
Installing ri documentation for bundler-1.7.10
gem: /usr/lib/llvm-3.4/include/llvm/Support/Casting.h:97: static bool llvm::isa_impl_cl<To, const From*>::doit(const From*) [with To = llvm::Constant; From = llvm::Value]: Assertion `Val && "isa<> used on a null pointer"' failed.
The Rubinius process is aborting with signal: SIGABRT
--- begin system info ---
sysname: Linux
nodename: willow
server {
server_name server.com;
root /home/production/server.com/current/public;
location ~* \.(ico|jpg|gif|png|swf|htm|html) {
if (-f $request_filename) {
expires max;
break;
}
@mustmodify
mustmodify / 1_stack_trace
Last active August 29, 2015 14:12
sshkit error
kernel/delta/kernel.rb:78:in `verbosity (method_missing)'
/home/jw/.rvm/gems/rbx-2.2.10/gems/sshkit-1.3.0/lib/sshkit/formatters/pretty.rb:10:in `<< (write)'
/home/jw/.rvm/gems/rbx-2.2.10/gems/sshkit-1.3.0/lib/sshkit/backends/printer.rb:14:in `execute'
kernel/common/kernel.rb:769:in `tap'
/home/jw/.rvm/gems/rbx-2.2.10/gems/sshkit-1.3.0/lib/sshkit/backends/printer.rb:13:in `invoke (execute)'
/home/jw/.rvm/gems/rbx-2.2.10/gems/capistrano3-puma-0.8.3/lib/capistrano/tasks/puma.cap:103:in `__script__' ( line 14 )
/home/jw/.rvm/gems/rbx-2.2.10/gems/sshkit-1.3.0/lib/sshkit/backends/abstract.rb:89:in `with'
/home/jw/.rvm/gems/rbx-2.2.10/gems/capistrano3-puma-0.8.3/lib/capistrano/tasks/puma.cap:97:in `__script__'
/home/jw/.rvm/gems/rbx-2.2.10/gems/sshkit-1.3.0/lib/sshkit/backends/abstract.rb:81:in `within'
/home/jw/.rvm/gems/rbx-2.2.10/gems/capistrano3-puma-0.8.3/lib/capistrano/tasks/puma.cap:96:in `__script__'
server {
server_name server.com;
root /home/production/server.com/current/public;
upstream www-server {
server unix:/home/production/server.com/shared/tmp/sockets/puma.sock;
}
location / {
@mustmodify
mustmodify / gist:09fb4e286ade10149942
Created January 9, 2015 18:47
with and without symlinking /vendor/bundle
--- without_linked_bundle 2015-01-09 12:33:56.567454917 -0600
+++ with_linked_bundle 2015-01-09 12:34:06.431455563 -0600
@@ -15,8 +15,8 @@
Running /usr/bin/env mkdir -p TARGET/shared TARGET/releases on willow.domain.com
Command: /usr/bin/env mkdir -p TARGET/shared TARGET/releases
Finished in x seconds with exit status 0 (successful).
-Running /usr/bin/env mkdir -p TARGET/shared/public/assets TARGET/shared/bin TARGET/shared/log TARGET/shared/tmp/pids TARGET/shared/tmp/cache TARGET/shared/tmp/sockets TARGET/shared/public/system on willow.domain.com
-Command: /usr/bin/env mkdir -p TARGET/shared/public/assets TARGET/shared/bin TARGET/shared/log TARGET/shared/tmp/pids TARGET/shared/tmp/cache TARGET/shared/tmp/sockets TARGET/shared/public/system
+Running /usr/bin/env mkdir -p TARGET/shared/public/assets TARGET/shared/bin TARGET/shared/log TARGET/shared/tmp/pids TARGET/shared/tmp/cache TARGET/shared/tmp/sockets TARGET/shared/vendor/bundle TARGET/shared/public/system on willow.domain.com
+Command: /usr/bin/