Skip to content

Instantly share code, notes, and snippets.

@lengarvey
lengarvey / database.sample.yml
Created May 30, 2013 03:04
Example database.yml that has different database per git branch
development:
adapter: postgresql
<% if `git symbolic-ref HEAD 2>/dev/null`.chomp.sub('refs/heads/', '').gsub(/\W/, '_') =~ /hotfix|release/ %>
database: YOUR_APP_NAME_HERE_development_master <% else %>
database: YOUR_APP_NAME_HERE_development_<%= `git symbolic-ref HEAD 2>/dev/null`.chomp.sub('refs/heads/', '').gsub(/\W/, '_')[0..20] %> <% end %>
pool: 5
timeout: 5000
host: localhost
test:
@lengarvey
lengarvey / staging.rb
Created June 29, 2014 11:28
Enabling Rails 4.1 mail previews in staging (or any other env besides development)
# put this in your staging.rb file. Obviously you'll need more config than this it's just an example.
Rails.application.configure do
config.action_mailer.preview_path ||= defined?(Rails.root) ? "#{Rails.root}/test/mailers/previews" : nil
config.autoload_paths += [config.action_mailer.preview_path]
routes.append do
get '/rails/mailers' => "rails/mailers#index"
get '/rails/mailers/*path' => "rails/mailers#preview"
end

Hey Ash,

I've decided to approach this lockdown a little different. I've got this gym and I want to use it as much as I can. So I've written a bit of a program for myself. Do you mind having a look over and tell me how crazy it is?

Goals are: get stronger with my front squat, stay active and motivated. I don't intend on pushing the other strength areas too much, but having them there keeps me happier.

Each day I'm planning to keep the strength portion to same to see if I can progress over the 6 weeks, with the idea being that I alternate between the metcons. On Wednesday and Thursday I intend on dialling into the zoom class for mobility and "barbell".

Monday - No cardio Monday

Focus on upping my front squat strength then working on heavy power cleans.

@lengarvey
lengarvey / irb_uri_parse.rb
Last active December 4, 2017 08:54
URI.parse issue with ruby-trunk.
irb(main):014:0* url = "https://bugs.ruby-lang.org/projects/ruby-trunk/issues?set_filter=1&f[]=status_id&op[status_id]=o"
=> "https://bugs.ruby-lang.org/projects/ruby-trunk/issues?set_filter=1&f[]=status_id&op[status_id]=o"
irb(main):015:0> URI.encode url
=> "https://bugs.ruby-lang.org/projects/ruby-trunk/issues?set_filter=1&f[]=status_id&op[status_id]=o"
irb(main):016:0> URI.parse url
URI::InvalidURIError: bad URI(is not URI?): https://bugs.ruby-lang.org/projects/ruby-trunk/issues?set_filter=1&f[]=status_id&op[status_id]=o
from /Users/artega/.rubies/ruby-trunk/lib/ruby/2.2.0/uri/rfc3986_parser.rb:47:in `split'
from /Users/artega/.rubies/ruby-trunk/lib/ruby/2.2.0/uri/rfc3986_parser.rb:53:in `parse'
from /Users/artega/.rubies/ruby-trunk/lib/ruby/2.2.0/uri/common.rb:223:in `parse'
from (irb):16

https://www.youtube.com/watch?v=3AMzRAjA0-o&t=3m36s

A technical Keynote

A Technical Keynote presented by Michael Feathers at the 2016 Mile High Agile Conference.

"Get business and development to work together" -> merge together -> get better at software development

cultural chasm between business and tech

we aren't seeing how endemic software is to the work we are doing

Hiring Remotely - Concerns

It's important to define what we mean by remote. There are a few levels:

  • In another office in my country.
  • Somewhere in my country.
  • In a foreign office as part of a "remote delivery team" aka: off-shoring.
  • Somewhere in the world.

The biggest concern I see is understanding how we will support remote workers as well as co-located people.

@lengarvey
lengarvey / nope.txt
Created March 16, 2016 23:58
fastly spam
Hi Leonard,
I'd like for you to speak with our engineering team to discuss caching REA Group's content on Fastly's real-time CDN.
Fastly serves content for Target, Twitter, New Relic, Cloudera and GitHub (among others).
With Fastly, you can:
Cache your dynamic or static content, objects, video, and APIs
Invalidate your cached content in 150 ms
Deploy your own custom configurations instantly

Admin and Markdown

Installing an Administration System

One of the big problems with our blog is that we're using HTTP Basic Authentication to prevent anyone from creating and editing blog posts and that the links to perform these actions are right there in the blog. Instead we'd prefer to have an admin panel where we could manage our blog posts. We could build one from scratch but there's a fantastic gem called ActiveAdmin which we can use to

Keybase proof

I hereby claim:

  • I am lengarvey on github.
  • I am lengarvey (https://keybase.io/lengarvey) on keybase.
  • I have a public key ASBClVV_b4RRQ8_WLlqFYRqKFrHV66xybv8Y4raQh8mfygo

To claim this, I am signing this object:

This was a case of me being really stupid.