Skip to content

Instantly share code, notes, and snippets.


Vincent Durand madwork

View GitHub Profile
madwork /
Last active Aug 29, 2015
Max OS X 10.9 + chruby + Ruby 2.1.1
brew install wget chruby openssl libyaml libxml2
cd /usr/local
git checkout 0181c8a Library/Formula/readline.rb
brew install readline
export ARCHFLAGS="-arch x86_64"
export CFLAGS="-g -O2"
export LDFLAGS="-L/usr/local/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/openssl/lib"
madwork / utf8-sanitizer.rb
Last active Aug 29, 2015
Utf8 Sanitizer Middleware
View utf8-sanitizer.rb
# Utf8Sanitizer
# Rack/Ruby on Rails: ArgumentError: invalid byte sequence in UTF-8
# raise 400 error
class Utf8Sanitizer
madwork / caesar_cipher.rb
Created Apr 17, 2015
Caesar Cipher Implementation in Ruby
View caesar_cipher.rb
# CaesarCipher
# Example:
# cipher = "Ruby is a dynamic, open source programming language!"
# cipher.encrypt(13)
# => "ehol vf n qlanzvp, bcra fbhepr cebtenzzvat ynathntr!"
class CaesarCipher
attr_accessor :sentence
def initialize(sentence)
@sentence = sentence
madwork /
Created Jul 1, 2015
keybase prove github madwork

Keybase proof

I hereby claim:

  • I am madwork on github.
  • I am madwork ( on keybase.
  • I have a public key whose fingerprint is E0C0 7490 6640 693C 8AEC BD3E 6BF4 9CEC 089D 7137

To claim this, I am signing this object:

madwork / app.html
Created Sep 9, 2015
Angular 1.3 Bind Once
View app.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>Bind Once</title>
<script src=""></script>
<script src=""></script>
<body ng-app>
<p><input type="text" ng-model="foo"></p>
madwork / .pryrc
Created Sep 24, 2015
Pry confie file
View .pryrc
require 'benchmark'
# sublime text as editor
Pry.config.editor = 'subl -w'
Pry.config.color = true
Pry.config.pager = true
# alias 'q' for 'exit'
Pry.config.commands.alias_command 'q', 'exit-all'
madwork / thin.god
Created Apr 12, 2012
Config file for god that configures watches for each instance of a thin server
View thin.god
# == God config file
# Authors: Gump and
# Config file for god that configures watches for each instance of a thin server for
# each thin configuration file found in /etc/thin.
# In order to get it working on Ubuntu, I had to make a change to god as noted at
# the following blog:
View Rakefile
require 'rake/testtask' do |t|
t.libs << 'lib'
t.libs << 'spec'
t.pattern = 'spec/**/*_spec.rb'
t.verbose = true
t.warning = false
View gist:3974516
module Urlize
def urlize
self.gsub(/[^[:alnum:]\-\s\_]/, '').split(/[\s\-\_]+/).delete_if{|i| i.empty?}.join('-').downcase
View manager.rb
class Manager
def self.configure(&block)
class Template
attr_reader :assets, :events
def initialize(&block)