Skip to content

Instantly share code, notes, and snippets.

View olivierlacan's full-sized avatar

Olivier Lacan olivierlacan

View GitHub Profile
@olivierlacan
olivierlacan / gist:4062929
Last active February 10, 2024 10:57 — forked from Gregg/gist:968534
Code School Screencasting Framework

Screencasting Framework

The following document is a written account of the Code School screencasting framework. It should be used as a reference of the accompanying screencast on the topic.

Why you should care about screencasting?

You're probably aren't going to take the time to read this document if you're not interested, but there are a lot of nice side effects caused by learning how to create quality screencasts.

  1. Communicating more effectively - At Envy Labs we produce screencasts for our clients all the time. Whether it's demoing a new feature or for a presentation for an invester, they're often much more effective and pleasent than a phone call or screen sharing.
@olivierlacan
olivierlacan / sublime-text-2-settings.json
Last active January 11, 2024 15:38
Basic Sublime Text 2 settings for Rails development
{
"use_simple_full_screen": false,
// calculates indentation automatically when pressing enter
"auto_indent": true,
// sets the colors used within the text area (default)
// see https://github.com/olivierlacan/monokaim to download
// the customized Monokai I use.
"color_scheme": "Packages/Color Scheme - Default/Monokaim.tmTheme",
@olivierlacan
olivierlacan / An_example.markdown
Created February 18, 2012 05:40 — forked from renz45/An_example.markdown
Re-style Sublime Text 2 sidebar to a darker theme

This re-styles your sublime text 2 sidebar to be darker, so it doesn't blind you when using a dark theme.

Dark sublime text 2 sidebar

Save the Default.sublime-theme file into packages/Theme - Default, make a backup of your original if you want to be able to go back easily.

@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 / assets.rake
Last active February 16, 2023 10:37
Missing precompile asset finder for Rails 4.x and Sprockets 3.x
# These instance variables allow you to define which tags we should check
# to find references to JavaScript and CSS files.
#
# Included first are the Rails defaults `javascript_include_tag` and
# `stylesheet_link_tag`. Next are examples of custom methods we use at
# Code School with the content_for method in order to include JS/CSS in
# specific location such as the <head> tag in this instance.
JS_TAGS = %w[ javascript_include_tag included_javascript_for_head ]
CSS_TAGS = %w[ stylesheet_link_tag linked_stylesheet_for_head ]
@olivierlacan
olivierlacan / launch_sublime_from_terminal.markdown
Created September 5, 2011 15:50
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@olivierlacan
olivierlacan / git_log.md
Created August 2, 2012 15:06
My git log custom output aliases
git config --global alias.hist "log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short"
git config --global alias.lol "log --graph --decorate --pretty=oneline --abbrev-commit --all"
git config --global alias.mylog "log --pretty=format:'%h %s [%an]' --graph"

To check that they've been added correctly, first run git config --list. You should see something like this in the midst of all your other configuration:

alias.hist=log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short
@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 / database.rake
Last active June 10, 2021 07:06
Database rake tasks that I use on Code School to ferret out huge tables with millions of rows and see how many indices they have and to see which tables have missing indices on associated tables (foreign keys). The latter was taken from this great post by Tom Ward: https://tomafro.net/2009/09/quickly-list-missing-foreign-key-indexes
namespace :database do
task fat_tables: :environment do
c = ActiveRecord::Base.connection
max_table_name_width = 0
tables = c.tables.sort_by do |t|
max_table_name_width = t.length if t.length > max_table_name_width