Skip to content

Instantly share code, notes, and snippets.

@mmmries
mmmries / gist:9009549
Created February 14, 2014 21:20
rubyhop :(
$ rubyhop
/Users/michael.ries/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `require': dlopen(/Users/michael.ries/.rvm/gems/ruby-2.1.0/extensions/x86_64-darwin-12/2.1.0-static/gosu-0.7.50/gosu.bundle, 9): Symbol not found: __ZNSbIwSt11char_traitsIwESaIwEE4_Rep11_S_terminalE (LoadError)
Referenced from: /Users/michael.ries/.rvm/gems/ruby-2.1.0/extensions/x86_64-darwin-12/2.1.0-static/gosu-0.7.50/gosu.bundle
Expected in: flat namespace
in /Users/michael.ries/.rvm/gems/ruby-2.1.0/extensions/x86_64-darwin-12/2.1.0-static/gosu-0.7.50/gosu.bundle - /Users/michael.ries/.rvm/gems/ruby-2.1.0/extensions/x86_64-darwin-12/2.1.0-static/gosu-0.7.50/gosu.bundle
from /Users/michael.ries/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
from /Users/michael.ries/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in `require'
from /Users/michael.ries/.rvm/gems/ruby-2.1.0/gems/gos
@mmmries
mmmries / expected_output.txt
Created February 28, 2014 19:59
TCP Server Example
$ ruby -v
ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin12.0]
$ ruby tmp/tcp_server.rb
Server :: client says: ping
Client :: server says: Hello! Time is 2014-02-28 12:55:54 -0700
Server :: client says: die!
Server :: farewell cruel world!
All Done!
@mmmries
mmmries / Gemfile
Last active August 29, 2015 14:00
Avro Gem Broken??? Or I don't understand it?
source "https://rubygems.org"
gem "avro", "1.7.5"
@mmmries
mmmries / installs.sh
Last active August 29, 2015 14:00
Raw Ubuntu 14.04 to Working Artoo
# Open the software sources and enable the multiverse + proprietary stuff
sudo apt-get install -y ruby1.9.1 ruby1.9.1-dev git
sudo gem install artoo-digispark --no-ri --no-rdoc
@mmmries
mmmries / talk.md
Created May 30, 2014 17:15
ArrrrCamp Talk Summary

Title

How I Accidentally Wrote the Best Code of my Career

Summary

Picking the right abstractions can be very hard. Understanding object design helps us evaluate tradeoffs, but where do you get the raw ideas to evaluate? I have to be creative? Lets talk about the 3rd rewrite of a system that came out surprisingly beautiful because we accidentally used a lot of creative processes.

@mmmries
mmmries / TextComparer.sh
Created August 28, 2014 14:33
nand2tetris helps
#!/bin/sh
cd `dirname $0`
java -classpath "${CLASSPATH}:bin/classes" TextComparer $1 $2
@mmmries
mmmries / benchmarks_1.md
Last active August 29, 2015 14:06
trigram_benchmark

Ruby 2.1.2

3 seconds of warmup

Calculating -------------------------------------
           load text         1 i/100ms
       generate text        55 i/100ms
-------------------------------------------------
           load text        6.9 (±14.4%) i/s -         66 in  10.090429s
       generate text      592.1 (±16.2%) i/s -       5775 in  10.073268s
@mmmries
mmmries / tradeoffs.md
Created November 27, 2014 05:10
Tradeoffs Between SOA vs Modular Ruby Code (gems / engines)

Modular Ruby

  • Easier to combine / split apart components and re-deploy (ie. change your design)
  • Easier to manage dependencies (ie. gem versions + bundler)
  • No need to coordinate deploys since bundler pulls it all together for you
  • No need to serialize / deserialize data (ie. JSON, protobuf, etc)
  • No need to do service discovery / load balancing between pieces
  • Less need for integration tests (ie a staging environment)
  • Sometimes you can get caught wanting to upgrade a gem or ruby version, but something else in your big Rails app needs to the lower version
@mmmries
mmmries / proposal.md
Last active August 29, 2015 14:13
Conventions Between Services

Conventions Between Applications

Description (200 words)

Rails gives us great conventions for building an application, but what conventions should we use when we are building a whole system that encompasses multiple applications? How should we name things? What abstraction layers should we enforce?

The MX team has been building a distributed system composed of Rails applications for the last 3 years. We'll talk about failed ideas, conventions that have stood the test of time and some experiments that are underway.

Justification

Much of what makes Rails great is the set of conventions that it gives us. We get naming conventions, architecture conventions, testing conventions, etc. No project sticks to every convention strictly, but having a convention forces us to choose which parts of our application really need to be unconventional.

@mmmries
mmmries / proposal.md
Created January 15, 2015 05:48
Facial Recognition and Robots with Ruby. What could go wrong?

Facial Recognition and Robots with Ruby. What could go wrong?

Description (200 words)

Have you ever thought about making a robot that could recognize faces? Did you want it to shoot darts or meet new people? Getting a robot to act intelligent requires a lot of computer science, but we can still use our favorite language to accomplish these tasks.

We'll see a few demos and look at some of the projects that help us abstract away the sciency bits so we can stay focused on making an awesome robot.

Justification

I like to have fun at a conference. What is more fun that seeing a demo go really well, or totally fail? Is there any better demo than seeing a nerf gun "search" for a target and try to shoot it? What about a lonely roomba that wanders around trying to make friends?