Skip to content

Instantly share code, notes, and snippets.

View dipth's full-sized avatar

Thomas Dippel dipth

  • Visioneers
  • Silkeborg, Denmark
View GitHub Profile
@dipth
dipth / bootstrap.sh
Created July 23, 2012 20:22
Bootstrap
#! /bin/sh
DROPBOX_PATH=~/Dropbox
###############################################################################
# Dropbox
###############################################################################
echo "Checking for existing Dropbox installation..."
if [ -d $DROPBOX_PATH ]
then
@dipth
dipth / i18n_db_lookup.rb
Created June 13, 2012 11:22
I18nDbLookup
class I18nDbLookup < I18n::Backend::Simple
def load_translations(*filenames)
# First we load the db-translations
load_translations_from_db
# Then we load the default yml-files
super
end
@dipth
dipth / after_symlink.rb
Created March 8, 2012 14:03
Limit Newrelic to only run on your Engineyard App Master instance
@dipth
dipth / spec_helper.rb
Created February 18, 2012 18:46
Override VCR's :body matcher to ignore order
VCR.configure do |c|
# Since HTTParty takes a Hash of body data, we can never be sure that it is
# sent in the same order. This can cause VCR to not recognize the request and
# therefore not use a previously recorded response.
# This overrides VCR's built-in :body matcher to ignore the order of the data
c.register_request_matcher :body do |request1, request2|
body1 = request1.body.split('&')
body2 = request2.body.split('&')
(body1 - body2).empty?
end
@dipth
dipth / File Settings - User
Created November 21, 2011 14:23
Sublime Text 2 Configuration
{
"color_scheme": "Packages/Color Scheme - Default/Twilight.tmTheme",
"font_size": 12,
"font_face": "Monaco",
"trim_trailing_white_space_on_save": true,
"scroll_past_end": true,
"ensure_newline_at_eof_on_save": true,
"auto_indent": true,
"tab_size": 2,
"translate_tabs_to_spaces": true
@dipth
dipth / network.yml
Created October 19, 2011 19:20
Tunneling to your local development computer
development:
tunnel:
public_host_username: root
public_host: [IP OF YOUR PUBLIC SERVER]
public_port: 3000
local_port: 3000
ssh_port: 22
server_alive_interval: 0
@dipth
dipth / .bash_profile
Created August 5, 2011 11:22
My bash profile
c_red='^[[31m'
c_green='^[[32m'
c_sgr0='^[[00m'
parse_git_branch ()
{
if git rev-parse --git-dir >/dev/null 2>&1
then
gitver=$(git branch 2>/dev/null| sed -n '/^\*/s/^\* //p')
if git diff --quiet 2>/dev/null >&2
@dipth
dipth / regex
Created July 30, 2011 18:06
Nykredit -> Freeagent
Use this regular expression to convert the exported csv-files from Nykredit to the csv-format required by FreeagentCentral.
Use the "convert commas to period", and "Omit headers" option when exporting from Nykredit.
Find: ^(\d{2})-(\d{2})-(\d{4});(.+?);(-?.+?);(N|J);(.+?);(\d{2}-\d{2}-\d{4})$
Replace: $1/$2/$3,$5,"$4"
@dipth
dipth / tests.watchr
Created February 14, 2011 12:08 — forked from boxedup/tests.watchr
ENV["WATCHR"] = "1"
system 'clear'
puts "I'm watching you..."
def growl(message)
growlnotify = `which growlnotify`.chomp
title = "Watchr Test Results"
image = message.include?('0 failure') ? "~/.watchr/passed.png" : "~/.watchr/failed.png"
options = "-w -n Watchr --image '#{File.expand_path(image)}' -m '#{message}' '#{title}'"
system %(#{growlnotify} #{options} &)
@dipth
dipth / benjamin.pub
Created January 31, 2011 14:14
My public key for Benjamin Interactive
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAwGtBJ+L5mJeZbHrM1mdHHlqZ3kpvyr+LlBmvxIty1W1Fou1wh7tPPDNe1FsFVafv9KSrm9vjnmDxfHrLGhjB6kY4Km+DZjfLF/2wunYab4ssbxrf6PSQU7+yyUAWg4BUlmnfNREkzG9b52xfOKRXYsnIoC3mdI/vdgcAxef9Dlv7P8o2FSyaju9vmw9pxXC5zQpA5jryjqW8Ab9pSOkTsegld6vEq8xULcV7w4DJtF7NJ6+eR9O6WUyKcXR4fTC/wUgxlV+mE0Z0fvneXKze9wmoEYyW/0Rd62QnA+CzsYG2Id/G8cbLGh/e0nMcNNLWL6/zf43ngEyeOrwSpCczsQ== thomas@thomas-dippels-macbook-pro.local