Skip to content

Instantly share code, notes, and snippets.

View davidcelis's full-sized avatar
Verified account

David Celis davidcelis

Verified account
View GitHub Profile
# A sample Gemfile
source "https://rubygems.org"
gem 'crepe', github: 'stephencelis/crepe'
gem 'puma'
gem 'rake'
gem 'app'
gem 'activerecord', require: 'active_record'
gem 'actionmailer', require: 'action_mailer'
@davidcelis
davidcelis / roobie.rb
Last active December 19, 2015 19:08
Cool story, Enumerator
2.0.0-p247> (1..10).to_enum
# => #<Enumerator: 1..10:each>
2.0.0-p247> (1..10).to_enum.size
# => nil
2.0.0-p247> (1..10).each
# => #<Enumerator: 1..10:each>
2.0.0-p247> (1..10).each.size
# => 10
@davidcelis
davidcelis / pagination.rb
Created June 30, 2013 20:14
Consuming Link header pagination in Ruby
# Link: <http://example.com/resources?page=2>; rel="next", <http://example.com/resources?page=5>; rel="last"
links = {}
headers['Link'].split(',').each do |link|
link.strip!
parts = link.match(/<(.+)>; *rel="(.+)"/)
links[parts[2]] = parts[1]
end
.wizard
- if section == 'new_building'
%a.current
%span.badge.badge-inverse 1
New Building
- else
%a
%span.badge 1
New Building
%a

It's with a heavy heart that I announce that Friday, May 31 2013 will be my last day at Heroku.

How can I possibly put into words what Heroku has meant to me these last six years? I can say it was a tremendous experience; or the opportunity of a lifetime; or the greatest thing I have ever been a part of. I can say that Heroku has been my life's work, as I did recently in a public blog post. All of those things are true, but none seem to capture the enormity of what's transpired these past six years.

I tend to focus on mechanical elements of a company: product, code, design, process. But what has surprised me the most at Heroku is that none of these things is the best part. The best part is the team.

I've never had the chance to work with a more singular group of people. Talented, passionate, skilled, dedicated. Most of all, sharing a set of values: elegance, craft, maniacal focus on simplicity; and an uncompromising belief that the future will be made of software, and how that software gets made will shape

@davidcelis
davidcelis / lol_unix.sh
Last active December 16, 2015 18:39
lol UNIX
david@droplet:~$ bluepill -v
bluepill, version 0.0.63
david@droplet:~$ which bluepill
/usr/local/bin/bluepill
david@droplet:~$ sudo bluepill -v
sudo: bluepill: command not found
david@droplet:~$ sudo which bluepill
@davidcelis
davidcelis / roobie.rb
Last active December 15, 2015 18:39
ruby.
>> 'hi' =~ /(?<xx>.*)/
# => 0
>> xx
# NameError: undefined local variable or method `xx' for main:Object
>> /(?<xx>.*)/ =~ "hi"
# => 0
>> xx
# => "hi"
@davidcelis
davidcelis / 2013_Ruby_on_Ales_notes.md
Last active December 14, 2015 15:39
Ruby on Ales 2013 — Conference Notes

Table of Contents

[The End of Fun][end-of-fun] ([@sarahmei][@sarahmei])

[Hacking Cognition][hacking-cognition] ([@1773807][@1337807])

[Services and Rails][services-and-rails] ([@brianxq3][@brianxq3])

[How Ruby Makes Better Beer][better-beer] ([@cadwallion][@cadwallion])

#!/usr/bin/env sh
if ! which md5sum > /dev/null; then
echo Install md5sum
exit 1
fi
if ! which curl > /dev/null; then
echo Install curl
exit 1
@davidcelis
davidcelis / 1.9.3-p362-perf.md
Last active October 17, 2016 11:28 — forked from burke/0-readme.md
Ruby 1.9.3-p362 cumulative performance patch for rbenv

NOTE: THIS PATCH DOES NOT APPLY. Falcon's performance patches have not been updated for p362. See the comments for a fork that uses the Rails Express patch set instead.

ruby-1.9.3-p362 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p362 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.

Requirements