- @TheLeadDev #LeadDevLondon
- white coat captioning - @whitecoatcapxg
- wvnts.co/lduk2018
- happy pride! it’s like the world cup for people with fashion sense
- who am I?
$ cd ~/Library/Application\ Support/Postgres/var-10
$ \rm -f postmaster.pid
OR
$ \rm -f ~/Library/Application\ Support/Postgres/var-10/postmaster.pid
📆 Jun 22-23, 2017
🌏 Web site: http://reddotrubyconf.com/ Twitter: http://twitter.com/reddotrubyconf
💁 Ping me @cheeaun on Twitter or leave a comment below if you found some awesome stuff for #rdrc2017. This gist will be updated whenever there's new stuff.
🕙 Previously, on RedDotRubyConf...
First, add pry-rails to your Gemfile:
https://github.com/rweng/pry-rails
gem 'pry-rails', group: :development
Then you'll want to rebuild your Docker container to install the gems
defmodule Map.Helpers do | |
@moduledoc """ | |
Functions to transform maps | |
""" | |
@doc """ | |
Convert map string camelCase keys to underscore_keys | |
""" | |
def underscore_keys(nil), do: nil |
require 'benchmark/ips' | |
array = (1..10_000).to_a | |
Benchmark.ips do |x| | |
x.report('each_with_object') { array.each_with_object([]) { |i,a| a << (i * 2) } } | |
x.report('map') { array.map { |i| i * 2 } } | |
x.report('map!') { array.map! { |i| i * 2 } } | |
x.report('reduse') { array.reduce([]) { |a,i| a << i * 2 } } | |
x.compare! |