Skip to content

Instantly share code, notes, and snippets.

View Hash#comprized?.diff
diff --git i/hash.c w/hash.c
index 007508a..6f39e47 100644
--- i/hash.c
+++ w/hash.c
@@ -2402,6 +2402,28 @@ rb_hash_flatten(int argc, VALUE *argv, VALUE hash)
return ary;
}
+static int
+hash_comprised_i(VALUE key, VALUE value, VALUE arg)
@olivierlacan
olivierlacan / Hash#contain?.patch
Last active Aug 29, 2015 — forked from nobu/Hash#comprized?.diff
Proposed implementation for Hash#contains? created by Nobu and slightly tweaked for semantics. Details here: http://olivierlacan.com/posts/proposal-for-a-better-ruby-hash-include/
View Hash#contain?.patch
diff --git i/hash.c w/hash.c
index 007508a..6f39e47 100644
--- i/hash.c
+++ w/hash.c
@@ -2402,6 +2402,28 @@ rb_hash_flatten(int argc, VALUE *argv, VALUE hash)
return ary;
}
+static int
+hash_contain_i(VALUE key, VALUE value, VALUE arg)
@olivierlacan
olivierlacan / gist:4062929
Last active Feb 10, 2021 — forked from Gregg/gist:968534
Code School Screencasting Framework
View gist:4062929

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 / gist:3278913
Created Aug 6, 2012 — forked from kyanny/gist:1668822
bashrc prompt git && rbenv
View gist:3278913
# rbenv
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
source ~/.rbenv/completions/rbenv.bash
# prompt with ruby version
# rbenv version | sed -e 's/ .*//'
__rbenv_ps1 ()
{
rbenv_ruby_version=`rbenv version | sed -e 's/ .*//'`
@olivierlacan
olivierlacan / rails_default_diff.sh
Created Jul 7, 2012
Track changes to a skeleton Rails app since a given version
View rails_default_diff.sh
#!/usr/bin/env zsh
# -------------------------------------------------------------------------------- #
# 1304046900 Track changes to a skeleton Rails app since a given `base_version`
# -------------------------------------------------------------------------------- #
## Changelog
# - Update 7/7/2012:
# * rewrote to use Bundler instead of RubyGems
# * attempting to switch to a master branch for which no commit existing was causing a pathspec error
# * simplified rails new commands by running them on the current path (after changing directory to tmp/skeleton_check of course).
# * renamed `old_version` variable to `base_version` for clarity
@olivierlacan
olivierlacan / An_example.markdown
Created Feb 18, 2012 — forked from renz45/An_example.markdown
Re-style Sublime Text 2 sidebar to a darker theme
View An_example.markdown

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 / .pryrc
Created Jan 5, 2012 — forked from renz45/.pryrc
Pry configuraton
View .pryrc
# switch default editor for pry to sublime text
Pry.config.editor = "sublime"
# format prompt to be <Rails version>@<ruby version>(<object>)>
Pry.config.prompt = proc do |obj, level, _|
prompt = "\e[1;30m"
prompt << "#{Rails.version} @ " if defined?(Rails)
prompt << "#{RUBY_VERSION}"
"#{prompt} (#{obj})>\e[0m"
end
@olivierlacan
olivierlacan / syntax_highlighting.py
Created Aug 31, 2011 — forked from JeanMertz/syntax_highlighting.py
Ruby on Rails syntax highlight switcher for Sublime Text 2
View syntax_highlighting.py
# ======================================================================================= #
# NOTE: This is relatively outdated, you should use the DetectSyntax package
# from Package Control instead: http://wbond.net/sublime_packages/community#sort-installs
# ======================================================================================= #
# Instructions: put this inside of the following folder on a Mac:
# /Users/<yourusername>/Library/Application\ Support/Sublime\ Text\ 2/Packages/User/
# ======================================================================================= #
import sublime, sublime_plugin
import os
@olivierlacan
olivierlacan / devise.my.yml
Created Jul 17, 2011 — forked from iqbalhasnan/devise.my.yml
Devise Malaysian Translation
View devise.my.yml
# Additional translations at http://github.com/plataformatec/devise/wiki/I18n
my:
errors:
messages:
not_found: "tidak dijumpai"
already_confirmed: "sudah disahkan"
not_locked: "tidak dikunci"
devise:
@olivierlacan
olivierlacan / devise.is.yml
Created Jul 17, 2011 — forked from sozialhelden/devise.is.yml
devise i18n translations for icelandic
View devise.is.yml
is:
errors:
messages:
not_found: "Afsakið, síða ekki fundin."
not_authorized: "Afsakið, auðkenning mistókst"
not_available: "Afsakið, þessu síða er tímabundið niðri."
not_existent: "Afsakið, þessi staður er ekki til lengur."
devise:
confirmations:
confirmed: "Aðgangurinn hefur verið staðfestur. Þú ert núna skráður inn"