Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
LOOKING INTENTLY INTO THE VOID

Daniel Schierbeck dasch

💭
LOOKING INTENTLY INTO THE VOID
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am dasch on github.
  • I am dasch (https://keybase.io/dasch) on keybase.
  • I have a public key whose fingerprint is EF11 DF25 B02F 0136 DF44 6EA9 CED4 AD42 717D 5ECC

To claim this, I am signing this object:

@dasch
dasch / git-pr
Created Dec 18, 2014
Open the GitHub compare page for a branch
View git-pr
#!/bin/bash
local_branch=$(git for-each-ref --format="%(refname:short)" $(git symbolic-ref HEAD))
remote_name=$(git config branch.$local_branch.remote)
remote_refspec=$(git config branch.$local_branch.merge)
remote_branch=${remote_refspec#refs/heads/}
remote_git_url=$(git config remote.origin.url)
remote_http_url=${remote_git_url#git@github.com:}
remote_http_url=${remote_http_url%.git}
github_url="https://github.com/$remote_http_url"
View gist:23898
" Vim color file
" Maintainer: Mingbai <mbbill AT gmail DOT com>
" Last Change: 2006-12-24 20:09:09
set background=dark
if version > 580
" no guarantees for version 5.8 and below, but this makes it stop
" complaining
hi clear
if exists("syntax_on")
View dasch.vim
" Vim color file
" Maintainer: Daniel Schierbeck <daniel DOT schierbeck PONY gmail UNICORN com>
" Last Change: 2008-11-25 16:41 GMT+1
set background=dark
if version > 580
" no guarantees for version 5.8 and below, but this makes it stop
" complaining
hi clear
if exists("syntax_on")
View mocha.vim
" Vim color file
" Maintainer: Daniel Schierbeck <daniel DOT schierbeck PONY gmail UNICORN com>
" Last Change: 2006-12-24 20:09:09
set background=dark
if version > 580
" no guarantees for version 5.8 and below, but this makes it stop
" complaining
hi clear
if exists("syntax_on")
View gist:41665
# Replaces "string1" with "string2" recursively
# Approach 1:
find ./ -type f | xargs sed -i 's/string1/string2/'
# Approach 2:
rpl -x'.cpp' -x'.h' -pR "string1" "string2" *
View Fixes T007_Index
From 68e1b50e28bf780f68424ac36602c3de9fdf51e7 Mon Sep 17 00:00:00 2001
From: Daniel Schierbeck <daniel.schierbeck@gmail.com>
Date: Sat, 17 Oct 2009 17:01:28 +0200
Subject: [PATCH] Changed type of Core.GitIndex.Members to a list
Using an array gave weird exceptions on Mono 2.0.
---
Core/GitIndex.cs | 4 ++--
Core/IndexTreeWalker.cs | 7 ++++---
Tests/T0007_Index.cs | 27 ++++++++++++++-------------
View shoulda-patch-68.diff
From 3b857c2663c516f3c63774b7b4c90dbb93935642 Mon Sep 17 00:00:00 2001
From: Daniel Schierbeck <daniel.schierbeck@gmail.com>
Date: Sat, 31 Oct 2009 01:51:48 +0100
Subject: [PATCH] Allow for Rails.root instead of RAILS_ROOT
RAILS_ROOT is being deprecated in Rails 3.0
---
lib/shoulda/rails.rb | 3 +++
lib/shoulda/test_unit.rb | 1 +
2 files changed, 4 insertions(+), 0 deletions(-)
View hookup.rb
context "A stack" do
setup { Stack.new(42) }
context "which gets #pop called on it" do
hookup { topic.pop }
asserts(:size).equals(0)
end
asserts(:size).equals(1)
end
View hallway_test.rb
require 'test_helper'
context "The Hallway model" do
setup { Hallway }
teardown { Hallway.delete_all }
hookup { create_hallway }
asserts(:count).equals(1)
asserts("adding duplicate") { create_hallway }.raises(ActiveRecord::RecordInvalid)