Skip to content

Instantly share code, notes, and snippets.

@juanpaulo
Last active August 29, 2015 14:06
Show Gist options
  • Save juanpaulo/db59b0a8377b3065c8cd to your computer and use it in GitHub Desktop.
Save juanpaulo/db59b0a8377b3065c8cd to your computer and use it in GitHub Desktop.
Barcelona Ruby Conference 2014 (Day 1)

Day 1

Opening

JEREMY WALKER @iHiD

require 'propono'

Propono.config do |config|
  config.access_key = "AKIAIPE2MSOM5ZFGQBCQ"
  config.secret_key = "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"
  config.queue_region = "eu-west-1"
end

require 'twitter'
@twitter = Twitter::REST::Client.new do |config|
  config.consumer_key = ""
  config.consumer_secret = ""
  config.access_token = ""
  config.access_token_secret = ""
end

# publisher.rb
require_relative 'config'
...
# subscribers.rb
require_relative 'config'
...


mruby: AltRuby

YUKIHIRO MATSUMOTO (@yukihiro_matz)

  • You-Key-Hero Matz-Motor
  • Varioius Ruby VMs
    • MRI - Matz’s Ruby Interpreter
    • Opal - Ruby to JS
    • mruby (https://github.com/mruby/mruby)
      • 2-year project granted by METI
      • Matsumoto’s, eMbedded, Minimalistic (generational incremental GC), Modular
        • MRB_USE_FLOAT, MRB_NAN_BOXING, MRB_USE_IV_SEG?
        • Will work on any environment that can run a C99 compiler
        • mrbgems - gem install mgem (https://github.com/mruby/mgem-list)
          • mruby-arduino
          • etc.
        • API design is something between Ruby & Lua

Standard Library, Uncommon Uses

PIOTR SZOTKOWSKI @chastell http://talks.chastell.net/baruco-2014/

  • Signore (https://github.com/chastell/signore)
    • signore prego [topic]
    • yaml/store - transaction-based
    • gserver (TCP server)
    • Tom Dale - Rails Node Perl Lisp
    • abbrev (https://github.com/rubysl/rubysl-abbrev)
    • Levenshtein Distance - levenshtein gem
    • drb/drb
    • typo_finder?
  • Summary
    • use a few more bits of core ruby
    • persist with pstore
    • serve with webrick
    • do play around with Enumerable
    • use stdlib (WeakRef!) and contribute to its docs
    • check out the levenshtein gem
    • End of Line (stdlib posts)
    • stop reinventing the wheel and come to ArrrCamp
# code snippets
module_function?
threads.flat_map(&:value)?

“One does not simply tag-complete to Mordor”


Twenty Thousand Leagues Under ActiveRecord

PAT SHAUGHNESSY @pat_shaughnessy http://patshaughnessy.net/2014/9/17/20000-leagues-under-activerecord http://patshaughnessy.net/2014/9/23/how-arel-converts-ruby-queries-into-sql-statements

User.all.where(name: “Captain Nemo”)
    .order(arel_table[primary_key].asc)
    .limit(1).to_a
  • Generating SQL
    • https://github.com/rails/arel
    • Visitor pattern
    • PostgreSQL
      • parse > Analyze and Rewrite > ? > ?
    • Executing SQL
      • byson (new version of yak?)
    • The B-Tree Algorithm
      • Balanced Tree Algorithm

Dive into the tools that you’re using


Release Responsibly

EMILY STOLFO @emstolfo http://www.slideshare.net/emstolfo/release-responsibly-maintaining-backwards-compatibility

  • Innovation and Stability are in conflict in Ruby community
  • Backwards compatibility
    • Simple API
      • Configurability and Stability are at odds
      • Do
        • Add arguments with default values, so old method calls still work
        • Add methods
        • Add subclasses
      • Don’t
        • Add arguments without default values
      • Have a Compatibility module
      • Use Polymorphism instead of conditionals
      • Backport only when necessary
  • Clear communication
  • Semantic versioning

How I built my own Twitch-Plays-Pokémon

JOSÉ TOMÁS ALBORNOZ @eljojo http://ajipirijou.com/

  • Used Sinatra
  • Problems
    • simulating keystrokes
    • requires desktop environment
    • latency
  • Built his own Gameboy emulator in Ruby
  • Conference Driven Development

Keep Software Weird

LEON GERSING @rubybuddha

  • Dominant culture, subculture, etc.
    • We simulate reality and we know it.
    • We lose touch with our actual reality.
    • The simulated reality becomes real.
  • Scrum as an example
    • Waterfall - dominant culture...
  • Invent reality
  • Perception is Reality

Morality is temporary, Wisdom is permanent Code is the representation of your current self at a point in time


A Dangerous Game: Safety in Ruby

RYAN LEVICK @itchyankles https://speakerdeck.com/rylev/a-dangerous-game-safety-in-ruby

  • Static typing
Redis.fetch(key: String): String
 Either...
  • What is the best testing library ever invented?
def head(list)
  if list.empty?
    # argument error!
  else
    list.first
  end
end
  • Idris
  # haskell
  head : Vect (S n) a -> a
  head (h::tail) = h
  # ruby
  x,y = [1,2]
  • No more runtime errors!
  • Erlang has this
  • Ruby is a tool, not the end solution to every problem

Lightning Talks

Oga XML/HTML parser written in Ruby

https://github.com/yorickpeterse/oga

  • 91% Ruby
  • Supports MRI, Rubinius, Jruby
  • Thread-safe
  • XML/HTML parsing
  • XMl namespaces
  • XPath
  • CSS selectors (planned)
  • No system libraries
$ gem install oga

Let's Sketch Note

@malweene

Shoes4 - Ruby for GUI

Tobias Pfeiffer @PragTob

  • GUI toolkit/DSL
  • cross-platform
  • packaging
  • all Ruby all the time
  • simple
  • JRuby + SWT

My Favourite Algorithm

@tomstuart

** Burrows-wheeler transform ** BANANA ANANAB NANABA ... ABANAN

  • sort then get last character
  • reversible

My Code Is More Popular Than Me

@philnash twilio

Nomadic Programmer

@arnvald

Lesson No. 1: Don't get burned out Lesson No. 2: You can do everything Lesson No. 3: You can work anywhere

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment