Skip to content

Instantly share code, notes, and snippets.

View rparker's full-sized avatar

Randy J Parker rparker

  • MobileDyne Systems, Inc
  • Atlanta
View GitHub Profile
~/sites/css (master⚡) rails c
Loading development environment (Rails 3.1.3)
[1] pry(main)> whereami
Error: Cannot find local context. Did you use `binding.pry`?
[2] pry(main)> c = County.where("nam = ?", 'dek').first;
Error: Cannot find local context. Did you use `binding.pry`?
[3] pry(main)> c.nam
NameError: undefined local variable or method `c' for main:Object
from (pry):1:in `<main>'
[4] pry(main)> c = County.where("nam = ?", 'dek')
@rparker
rparker / libyruby_with_i386
Created July 28, 2011 20:08
Manual addition of "-arch i386" to compilation of libruby
// Run the vanilla "rvm install 1.9.2" command after setting your .rvmrc to include the line: rvm_archflags="-arch i386"
// After it fails, type: file ~/.rvm/src/ruby-1.9.2-p290/libruby.dylib
// On my system, "file" says: ==> libruby.dylib: Mach-O 64-bit dynamically linked shared library x86_64
// even though "file" on the all the ".o" files says (correctly) "i386".
// So I cut-n-pasted the line below tagged <TYPE THIS BY HAND> from the ~/.rvm/log/ruby-1.9.2-p290/make.log file.
// After pasting it, but before hitting <RETURN>, I manually added the "-arch i386" bit.
------------------------------------------------------------------------
this 12-line file is "send.rb"
------------------------------------------------------------------------
#!/usr/bin/env ruby
require 'rubygems'
require 'socket'
sock = TCPSocket.new 'localhost', 9814
t0 = Time.now
@rparker
rparker / EM Clairvoyant Delay
Created May 18, 2011 14:22
Remote App that does socket.write(cmd) does not get socket.recvfrom(16) 'til after printing completes!
class Feeder < EventMachine::Connection
def initialize(q)
@q = q
end
# Only the first and last lines will stay after this is debugged
# How can the send_data() or the remote's recvfrom() not complete
# until after the channel.push() subscriber gets done, 30 minutes from now?
def receive_data(cmd)
send_data cmd + '.'@(16 - cmd.size) # ack to the web app, padded to fill recvfrom(16)
Bill, Pete, Matt, Paul & John
I just watched a "Sixty Symbols" video in which a British "Jet Engine Expert" claims that a USGS report showed that volcanic ash causes flame out by "blocking the airflow through the guide vanes and turbine"
So I found this USGS paper: , which ....
determined the following mechanisms that can affect aircraft performance due to exposure to a volcanic ash cloud:
(a) deposition of material on hot-section components,
(b) erosion of compressor blades and rotor-path components,
(c) blockage of fuel nozzles and cooling passages,
class CreateDispos < ActiveRecord::Migration
def self.up
create_table :dispos do |t|
t.integer :property_id, :null => false # fk
t.string :state
t.string :first_name
t.string :middle_name
t.string :last_name
t.string :name_suffix
Yes, adding Errno::EPIPE seems to have completely solved the problem!
(barring very unlikely coincidences)
Thank you !
For reference, the line # was correct for my "remote_fetcher.rb" file from June 3, 2009 in rubygems 1.3.5
My lines 337 - 340 are now:
# HACK work around EOFError bug in Net::HTTP
# NOTE Errno::ECONNABORTED raised a lot on Windows, and make impossible