Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View olivierlacan's full-sized avatar

Olivier Lacan olivierlacan

View GitHub Profile
@olivierlacan
olivierlacan / matz_edit_of_contributor_covenant_1-3-0.md
Created January 22, 2016 23:57
This is an edit of the Contributor Covenant code of conduct version 1.3.0 that was created by Matz during the conversation here: https://bugs.ruby-lang.org/issues/12004#note-95

Contributor Code of Conduct

As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.

We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance,

@olivierlacan
olivierlacan / beur_fm_amazing_parisian_lady.md
Last active November 17, 2015 04:16
Translation of Beur FM interview with amazing Parisian lady.

This older Parisian lady says the following:

"It's very important to bring flowers to our dead. It's very important to see multiple times Hemingway's book 'Paris is a Moveable Feast' because we are a very ancient civilization and we will carry our values up high, and we will fraternize with 5 Million Muslims who practice their religion freely and kindly. And we will fight the 10,000 barbarians who kill — supposedly — in the name of Allah."

Video: https://www.facebook.com/BeurFMOfficiel/videos/10153037168042126/

So fucking proud.

@olivierlacan
olivierlacan / le_petit_journal_angel_le_son.md
Last active November 17, 2015 03:22
Translation of Angel Le's son being interviewed by Le Petit Journal

Video here: https://www.facebook.com/PetitJournalYannBarthes/videos/1013093998733798/

  • Interviewer: "Do you understand what happened?"
  • Kid: "Yes because they're really really mean. Mean people are mean. And we have to be careful and change house."
  • Dad: "No, don't worry. We don't have to change homes. France is our home."
  • Kid: "But there are mean people, daddy."
  • Dad: "Yes, but there are mean people everywhere."
  • Kid: "They have guns, they can shoot us because they're really really mean."
  • Dad: "It doesn't matter, they have guns and we have flowers."
  • Kid: "But flowers they do nothing, it's for..."
@olivierlacan
olivierlacan / github_conflict_resolution.md
Created August 29, 2015 19:03
I dream of easier merge conflict resolution on GitHub Pull Requests

Howdy,

It's currently a bit of a hassle (unless I'm doing it wrong) to fix a PR that used to be green but is now unmergeable due to an simple little merge conflict with master.

It would be quite fantabulous if I could access the swanky invisible PR branches from the web interface in order to quickly fix the merge conflict and merge/close the PR without having to:

  • ask & wait for the submitter to fix a conflict they might not understand better than I do (since master likely caused it if the branch is green)
  • tediously add the submitter's repo as a remote and pull their branch, merge master in it to fix the conflict and either submit a PR to their fork or merge it into master directly (which sadly by-passes the existing PR)
  • do the local PR checkout trick (but I'm lazy, don't make me do it!)

A dream solution that would make GitHub even more addictive would be an interactive conflict resolutio

@olivierlacan
olivierlacan / css.rb
Created August 29, 2015 17:58
Decoupling CSS IDs from RSpec/Capybara feature specs with centralized YAML list. We use this for Code School feature specs.
# Defines a method returning the selector for a CSS selector
# used within the test suite to scope a feature spec.
#
# Developers: always use these instead of hard-coding CSS selectors
# when scoping or selecting crucial elements on a page.
# Designers: always check this module before/after modifying existing
# classes or IDs that may cause test failures
#
# Example usage:
# - page.should have_selector(CSS.some_method)
@olivierlacan
olivierlacan / migrate_postgresql_database.md
Last active March 24, 2022 20:30
How to migrate a Homebrew-installed PostgreSQL database to a new major version (9.3 to 9.4) on OS X. See upgraded version of this guide: http://olivierlacan.com/posts/migrating-homebrew-postgres-to-a-new-version/

This guide assumes that you recently run brew upgrade postgresql and discovered to your dismay that you accidentally bumped from one major version to another: say 9.3.x to 9.4.x. Yes, that is a major version bump in PG land.

First let's check something.

brew info postgresql

The top of what gets printed as a result is the most important:

@olivierlacan
olivierlacan / climate_control.rb
Last active February 28, 2023 14:35
Climate Control RSpec support helper
# in spec/support/climate_control.rb
module ClimateControlHelper
def with_modified_env(options, &block)
ClimateControl.modify(options, &block)
end
end
RSpec.configure do |config|
config.include(ClimateControlHelper)
@olivierlacan
olivierlacan / paris_design.md
Last active August 29, 2015 14:14
Paris Design
@olivierlacan
olivierlacan / changelog_parser.rb
Last active August 29, 2015 14:14
Really naive CHANGELOG parser we used on Code School for a while to export public-facing release notes from a private-ish CHANGELOG.md file.
require 'vandamme'
module PagesHelper
def changes
changes = {}
sections = changelog_file.each_with_index do |day, index|
change_sets = {}
day[1].scan(section_title_scanner) do |match|
@olivierlacan
olivierlacan / gist:cafddd3fbed4593c3b25
Created December 27, 2014 19:30
Ruby 2.2.0 & Rails 4.2.0 app push fail
-----> Fetching custom tar buildpack... done
-----> Ruby app detected
-----> Compiling Ruby/Rails
!
! Command: 'set -o pipefail; curl --fail --retry 3 --retry-delay 1 --connect-timeout 3 --max-time 20 https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/ruby-2.2.0.tgz -s -o - | tar zxf -' failed unexpectedly:
!
! gzip: stdin: unexpected end of file
! tar: Child returned status 1
! tar: Exiting with failure status due to previous errors
!