Skip to content

Instantly share code, notes, and snippets.

View datenimperator's full-sized avatar

Christian Aust datenimperator

View GitHub Profile
@media print {
h1 + p, h2 + p, h3 + p, h4 + p, h5 + p, h6 + p {
page-break-before: avoid;
}
}
@datenimperator
datenimperator / i18n.rb
Created July 19, 2013 15:16
Did you ever wonder what your Rails i18n is doing? Why your translation isn't found? Add this initializer to log every i18n translation as it happens.
I18n::Backend::Base.class_eval do
def translate_with_logging(locale, key, options = {})
Rails.logger.debug " i18n: #{locale} #{key} #{options.inspect}"
translate_without_logging(locale, key, options)
end
alias_method_chain :translate, :logging
end
@datenimperator
datenimperator / dkms.conf
Created May 18, 2013 07:56
dkms.conf is in /usr/src/r8168-8.035.00
PACKAGE_NAME=r8168
PACKAGE_VERSION=8.035.00
MAKE[0]="'make' modules"
BUILT_MODULE_NAME[0]=r8168
BUILT_MODULE_LOCATION[0]="src"
DEST_MODULE_LOCATION[0]="/kernel/updates/dkms"
AUTOINSTALL="YES"
Delivery to the following recipient failed permanently:
support@sipgate.de
Technical details of permanent failure:
Message rejected by Google Groups. Please visit http://mail.google.com/support/bin/answer.py?hl=en&answer=188131 to review our Bulk Email Senders Guidelines.
----- Original message -----
X-Received: by 10.15.22.197 with SMTP id f45mr7583815eeu.46.1364562843507;
source 'http://rubygems.org'
gem 'nesta', '~> 0.9.13'
gem 'haml'
gem 'haml-coderay'
gem 'sass'
gem 'compass'
gem 'sprockets-sass'
@datenimperator
datenimperator / Gemfile
Created November 12, 2012 05:44
Sinatra deferred reaction
source 'https://rubygems.org'
# Specify your gem's dependencies in poi_api.gemspec
gem 'rack'
gem 'sinatra'
gem 'shotgun'
@datenimperator
datenimperator / scan.rb
Created July 19, 2012 10:53
Given a number of home directories containing Maildir subdirectories, I want to recursively count both unread and total messages, along with the date/time of the first/last message in that Maildir. This script is supposed to run from the base directory co
#!/usr/bin/env ruby -w
result = Hash.new{|h, k| h[k] = {
:count => 0,
:unread => 0,
:first => nil,
:last => nil
}
}
Last login: Thu Mar 8 09:53:01 on ttys000
c.aust@macbookpro:~$ pip
-bash: pip: command not found
c.aust@macbookpro:~$ brew install pip
Error: No available formula for pip
Install pip with easy_install:
easy_install pip
c.aust@macbookpro:~$ easy_install pip
Traceback (most recent call last):
c.aust@macbookpro:~$ curl -i http://bscope:8098/riak/test_my_kv_search
HTTP/1.1 200 OK
Vary: Accept-Encoding
Server: MochiWeb/1.1 WebMachine/1.9.0 (someone had painted it blue)
Date: Fri, 02 Mar 2012 15:00:26 GMT
Content-Type: application/json
Content-Length: 435
{"props":{"name":"test_my_kv_search","allow_mult":false,"basic_quorum":false,"big_vclock":50,"chash_keyfun":{"mod":"riak_core_util","fun":"chash_std_keyfun"},"dw":"quorum","last_write_wins":false,"linkfun":{"mod":"riak_kv_wm_link_walker","fun":"mapreduce_linkfun"},"n_val":3,"notfound_ok":true,"old_vclock":86400,"postcommit":[],"pr":0,"precommit":[],"pw":0,"r":"quorum","rw":"quorum","small_vclock":50,"w":"quorum","young_vclock":20}}
c.aust@macbook-pro:~$ curl -I -H 'Accept-Encoding: gzip,deflate' http://budokan-yanagi.de/js/jquery-1.7.1.min.js
HTTP/1.1 200 OK
Date: Thu, 05 Jan 2012 10:58:18 GMT
Server: Apache/2.2.14 (Ubuntu)
ETag: "db2cccefedcc741a45a582e91a5afe8d"
X-Rack-Cache: fresh
X-Content-Digest: d1e1f3f0828fa66fb5744f42bc912694e06300f9
Cache-Control: max-age=2592000, public
Age: 3114
Status: 200