Skip to content

Instantly share code, notes, and snippets.


Carlo Zottmann czottmann

View GitHub Profile
czottmann / De-Apostroph-ierer
Created March 13, 2014 09:43
Bookmarklet zur temporären Vernichtung aller Apostrophen
View De-Apostroph-ierer
javascript:(function(){$('p').each(function(){var $p=$(this);$p.html($p.html().replace('%E2%80%99',''));})})();
# ### Defining the prompt
# Example output:
# |1.9.3| Illium in /Users/carlo/Code
# |gh-pages| ➔
function fish_prompt
# line 1: "|{Ruby version}| {hostname} in {current path}"
View langoliers.rb
#!/usr/bin/env ruby
require 'rubygems'
require 'twitter'
require 'json'
require 'faraday'
# things you must configure
PATH_TO_DROPBOX = "/Users/your_name/Dropbox/backup/tweets/" # you need to create this folder
TWITTER_USER = "your_twitter_username"
czottmann / untitled
Created April 15, 2015 19:52
bundle exec rake test
View untitled
Loaded suite /Users/carlo/.rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/rake_test_loader
Browserify: /Users/carlo/Code/browserify-rails/test/dummy/node_modules/.bin/browserifyinc -t coffeeify --extension="" --list --cachefile="/Users/carlo/Code/browserify-rails/test/dummy/tmp/cache/browserify-rails/browserifyinc-cache.json" -o "/Users/carlo/Code/browserify-rails/test/dummy/tmp/cache/browserify-rails/output20150415-64722-1hj7bc9" -
Browserify: /Users/carlo/Code/browserify-rails/test/dummy/node_modules/.bin/browserifyinc -t coffeeify --extension="" --cachefile="/Users/carlo/Code/browserify-rails/test/dummy/tmp/cache/browserify-rails/browserifyinc-cache.json" -o "/Users/carlo/Code/browserify-rails/test/dummy/tmp/cache/browserify-rails/output20150415-64722-1rf4b7w" -
Browserify: /Users/carlo/Code/browserify-rails/test/dummy/node_modules/.bin/browserifyinc -t coffeeify --extension="" --list --cachefile="/Users/carlo/Code/browserify-rails/test/dummy/tmp/cache/browserify-rails/bro

Keybase proof

I hereby claim:

  • I am carlo on github.
  • I am czottmann ( on keybase.
  • I have a public key whose fingerprint is 6C4E E45B 6197 65C0 9412 910C 76EE B33E 1BD3 A059

To claim this, I am signing this object:

View current_implementation.rb
# The problem is that the Person object currently has two sub-objects:
# PersonFirstname and PersonLastname, and both have a @value attribute, which
# is suboptimal.
# Is there a way to end up with a Person object that has both @firstname and
# @lastname, without extraneous child objects?
class PersonFirstname
include HappyMapper
tag "firstname"
View item.rb
module HappyMapper
class Item
def value_from_xml_node(node, namespace=nil)
node.register_default_namespace(namespace.chop) if namespace
if element?
depth = options[:deep] ? './/' : ''
result = node.find_first("#{depth}#{namespace}#{tag}")
if tag.match(/\/@[a-z\d]+$/i)
View gist:43787
describe "Kernel#retryable" do
it "should not affect the return value of the block given" do
retryable { 'foo' }.should == 'foo'
it "should not affect the return value of the block given when there is a retry" do
num_calls = 0
ret_val = retryable_deluxe do
num_calls += 1
View gist:44268
class MyClass
attr_reader :myvar
def initialize
@myvar = "omg"
def do_stuff
# Found @
# Changelog
# 0.01 - Initial version
# 0.02 - Huffdic compressed books were not properly decrypted
import sys,struct,binascii