Skip to content

Instantly share code, notes, and snippets.

@jm
jm / text.md
Created December 1, 2015 15:37
Peanuts in PNG

It's Giving Tuesday! I have something to give to: mamas in Papua New Guinea who don't have access to good pregnancy nutrition and literature.

My in laws are missionaries there, and they've seen first hand that the lack of education and bad diet causes a lot of birth defects and premature births. For instance, mothers don't really know that smoking is bad for babies. They also chew a nut called buai that is bad for them but they won't stop due to addiction and its alleged morning sickness curing abilities. Likewise their diets lack a lot of essential things that babies need, and since they're mostly a sustenance economy, that means if they don't grow it, they don't eat it. Thos factors combined with a lack of solid healthcare in PNG means that mothers are often left to deal with the pain and difficulty of defects and death.

So what's the thing you're giving to? I'm working with some folks to setup a non-profit here in the U.S. to work with doctors and nationals in PNG to develop nutrition and education

/opt/rbenv/versions/1.8.7-p358/lib/ruby/gems/1.8/gems/redis-3.0.1/lib/redis/client.rb:257:in `establish_connection': undefined method `connect' for Redis::Connection::Hiredis:Class (NoMethodError)
from /opt/rbenv/versions/1.8.7-p358/lib/ruby/gems/1.8/gems/redis-3.0.1/lib/redis/client.rb:63:in `connect'
from /opt/rbenv/versions/1.8.7-p358/lib/ruby/gems/1.8/gems/redis-3.0.1/lib/redis/client.rb:216:in `without_socket_timeout'
from /opt/rbenv/versions/1.8.7-p358/lib/ruby/gems/1.8/gems/redis-3.0.1/lib/redis/client.rb:158:in `call_without_timeout'
from /opt/rbenv/versions/1.8.7-p358/lib/ruby/gems/1.8/gems/redis-3.0.1/lib/redis.rb:946:in `_bpop'
from /opt/rbenv/versions/1.8.7-p358/lib/ruby/gems/1.8/gems/redis-3.0.1/lib/redis.rb:36:in `synchronize'
from /opt/rbenv/versions/1.8.7-p358/lib/ruby/1.8/monitor.rb:242:in `mon_synchronize'
from /opt/rbenv/versions/1.8.7-p358/lib/ruby/gems/1.8/gems/redis-3.0.1/lib/redis.rb:36:in `synchronize'
from /opt/rbenv/versions/1.8.7-p358/lib/ruby/gems/1.8/gems/redis-3.0.1/lib/r
AWESOMENESS.
@jm
jm / cli_definition.sh
Created April 19, 2012 14:48
Railcar CLI
# Add an app to Railcar list (it'll update in the UI automagically):
railcar add .
railcar app ~/code/myapp
# Launch an app already in the list; this will let us control the app using Railcar and add other features
railcar launch ~/path
railcar launch app_name # You can set the app name/alias in Railcar
# Stop a launched app
railcar stop ~/path
@jm
jm / thoughts.rb
Created April 19, 2012 14:40
Thinking on teaching code/Rails
##############
# Lesson file
##############
title "Getting started with Rails"
description "A quick tutorial to run you through a basic Rails application"
steps %w {
install.rb
app.rb
@jm
jm / gist:2368029
Created April 12, 2012 15:13
Talk proposal
[rubyist learn:@"Cocoa" withLanguage:@"MacRuby"];
-------------------------------------------------
Cocoa is a fantastic set of libraries to work with, but Objective-C can be a bit of a verbose beast. MacRuby offers Rubyists a great way to use the whole framework, but with a beautiful, developer friendly language.
The only catch is that idiomatic Cocoa is kind of weird for a Rubyist. What's a delegate? Aren't we not supposed to use threads in Ruby? It gets even dicier if one decides to write a GUI application, since most of us are writing web apps and don't encounter the concept of a run loop and don't worry about blocking the main thread for users typically. Why is this API so ugly? The unfamiliarity with the assumptions and idioms underlying MacRuby can make it just as hard (or harder!) to pick up.
This talk is a solution for the confusion. We'll take 6 core Cocoa concepts and look at what they are, how they're used in Cocoa, and use MacRuby to show their usage. We'll look at:
* Syntax (patter
@jm
jm / integrations.md
Created March 20, 2012 13:11
Current integrations

SCM

  • Github
  • Bitbucket
  • Beanstalk
  • Google Code
  • Unfuddle

Ticketing

Remove me from this list and please don't contact me again by any means. That means don't e-mail me, don't call me, don't find me at conferences, don't send carrier pigeons to my house with small notes attached to their feet, don't even wave to me in the street if you see me. I'll snub you right there in public and that will be really awkward for you. I can't be held responsible if your friends don't talk to you anymore after that. And no, I don't care how great your position supposedly is, what technology it's using, where it's at, how many celebrities are invested, how close they are to closing funding, how much equity they're offering, how many times Paul Graham has high-fived the founders, how close they are to the Mission in San Francisco, how much the position is paying, how great the company is, who claims they know me that works there, how big their signing bonus is, or who I'll supposedly be working for/with. I'm not interested.

Just once more to be totally clear: don't contact me again. At al

» 3.6GHz quad core Intel E2-1230
» IPMI/KVM: Included free of charge! Full remote control/reboot/OS reload.
» Hardware Firewall: No thanks
» Anti SPAM Device: No thanks
» Hard Drives: 2x 2TB Monthly Upgrade Fee (1 free, 1 additional) $30.00 USD
» SSD Drives: No SSD Drive (Allows 4 Hard Drives)
» IP Addresses: 5 Usable IPs $5.00 USD
» Bandwidth: 20,000GB (20TB) on 1 Gigabit Port $15.00 USD
» RAM: 16GB DDR-3 ECC
» Management: Unmanaged, no support
# Let's say I have two AR models...
class Cabinet < ActiveRecord::Base
has_many :files, :class_name => "CabinetFile"
end
class CabinetFile < ActiveRecord::Base
belongs_to :cabinet, :inverse_of => :files, :counter_cache => true
end