Skip to content

Instantly share code, notes, and snippets.

@pex
pex / countries_by_iso_code.de.yml
Created July 20, 2012 20:20
German Country Translations by ISO Code and Name
de:
countries:
AC: Ascension
AD: Andorra
AE: Vereinigte Arabische Emirate
AF: Afghanistan
AG: Antigua und Barbuda
AI: Anguilla
AL: Albanien
AM: Armenien
@pex
pex / 0-readme.md
Created August 1, 2012 09:09 — forked from sj26/0-readme.md
ruby-1.9.3-p194 cumulative performance patch.

Patched ruby 1.9.3-p194 for 30% faster rails boot

What is?

This script installs a patched version of ruby 1.9.3-p194 with patches for boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.

Huge thanks to funny-falcon for the performance patches.

@pex
pex / Default (OSX).sublime-keymap
Created November 20, 2012 15:00
SublimeText2 Config
[
{ "keys": ["super+alt+5"], "command": "unindent" },
{ "keys": ["super+v"], "command": "paste_and_indent" },
{ "keys": ["super+shift+v"], "command": "paste" }
]
@pex
pex / README.md
Created November 20, 2012 19:24
English / German Keyboard Layout

English / German keyboard layout for MacBooks with english international keyboard

(with some improvements for hacking)

German Mappings

  • ä: ⎇ + a
  • Ä: ⎇ + ⇧ + a
  • ö: ⎇ + o
  • Ö: ⎇ + ⇧ + o
@pex
pex / auth.rb
Last active December 19, 2015 05:19 — forked from abloom/ejabberd_auth.rb
IMAP authentication for ejabberd in Ruby
#!/usr/bin/env ruby
require 'net/imap'
require 'logger'
$stdout.sync = true
$stdin.sync = true
path = "/usr/local/var/log/ejabberd/auth.log"
file = File.open(path, File::WRONLY | File::APPEND | File::CREAT)
@pex
pex / FizzBuzz
Last active August 29, 2015 13:56
FizzBuzz
Write a program that prints the numbers from 1 to 100.
But for multiples of three print “Fizz” instead of
the number and for the multiples of five print “Buzz”.
For numbers which are multiples of both three and five print “FizzBuzz”.
@pex
pex / done.rb
Last active August 29, 2015 14:00
"Stack level is too deep" when stubbing rather complex chained method and a prepended module
STACK = []
module Concerns
module Done
def on_done
STACK << 'Concerns::Done'
end
end
module DonePrepender
/usr/local/opt/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bundler/gems/rspec-core-4219c4786f6f/lib/rspec/core.rb:5:in `<top (required)>': undefined method `require_rspec_support' for RSpec::Support:Module (NoMethodError)
from /usr/local/opt/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bundler/gems/rspec-core-4219c4786f6f/exe/rspec:3:in `require'
from /usr/local/opt/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bundler/gems/rspec-core-4219c4786f6f/exe/rspec:3:in `<top (required)>'
from /usr/local/opt/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bin/rspec:23:in `load'
from /usr/local/opt/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bin/rspec:23:in `<main>'
#!/bin/sh
# cloudflareddns.sh - dynamic dns updater module for Synology
#
# Author:
# Michael Wildman (http://mwild.me)
#
# Version:
# 0.2
#
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'