Skip to content

Instantly share code, notes, and snippets.

View tmschndr's full-sized avatar

Tim Schneider tmschndr

View GitHub Profile

Keybase proof

I hereby claim:

  • I am tmschndr on github.
  • I am tmschndr (https://keybase.io/tmschndr) on keybase.
  • I have a public key whose fingerprint is 4EC8 4DC5 4B87 D176 FBCD ED47 A3F5 C7B6 6D09 2DAA

To claim this, I am signing this object:

@tmschndr
tmschndr / check_location.rb
Created September 11, 2012 10:30
what's the most readable version? Or do know a even better solution? :)
class Tweet < ActiveRecord::Base
before_save :check_location
def check_location
show_location = location?
end
end
<?xml version="1.0"?>
<teams>
<team>
<name>Algerien</name>
<short_name>ALG</short_name>
<squad>
<goalkeepers>
<player>Chaouchi, Faouzi</player>
<player>Gaouaoui, Lounes</player>
<player>M'Bohli, Rais</player>
@tmschndr
tmschndr / bcc3.haml
Created June 8, 2009 09:23
#bcc3 - markup haiku mit haml und sass (by @skddc and @tmschndr)
!!!
%html{ :xmlns => "http://www.w3.org/1999/xhtml", "xml:lang" => "de-DE", :lang => "de-DE"}
%head
%meta{"http-equiv" => "content-type", :content => "text/html; charset=UTF-8"}
%meta{"http-equiv" => "content-style-type", :content => "text/css"}
%meta{"http-equiv" => "content-script-type", :content => "text/javascript"}
%meta{:name => "keywords", :content => "#haml, sass, bcc3, barcamp, cologne, awesome"}
%meta{:name => "description", :content => "eine einführung und etwas mehr in markup haiku mit #haml und sass"}
%meta{:name => "author", :content => "@tmschndr und @skddc"}
%meta{:name => "language", :content => "de"}
!!!
%html{ :xmlns => "http://www.w3.org/1999/xhtml", "xml:lang" => "de-DE", :lang => "de-DE"}
%head
%meta{"http-equiv" => "content-type", :content => "text/html; charset=UTF-8"}
%meta{"http-equiv" => "content-style-type", :content => "text/css"}
%meta{"http-equiv" => "content-script-type", :content => "text/javascript"}
%meta{:name => "keywords", :content => "#haml, sass, bcc3, barcamp, cologne, awesome"}
%meta{:name => "description", :content => "eine einführung und etwas mehr in markup haiku mit #haml und sass"}
%meta{:name => "author", :content => "@tmschndr und @skddc"}
%meta{:name => "language", :content => "de"}
@tmschndr
tmschndr / gist:125339
Created June 7, 2009 14:07
make editable bookmarklet
javascript:document.body.contentEditable='true';%20document.designMode='on';%20void%200
@tmschndr
tmschndr / gist:125333
Created June 7, 2009 13:53
my lovely bash
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
PS1="\n<\[\033[0;32m\]\h\[\033[0m\]:\[\033[0;37m\]\u\[\033[0m\]> \! [\$(date +%d.%m.\" \"%H:%M)] \w \[\033[0;36m\]\$(parse_git_branch)\n! "
@tmschndr
tmschndr / gist:125329
Created June 7, 2009 13:40
sass fun. hacked with http://github.com/skddc before our sass-session at barcampcologne3 #bcc3
!base_font_size = 15px
!base_color = #000
#tag_cloud
@for !n from 1 through 10
.importance_#{!n}
:font-size= round(!base_font_size + ((!base_font_size / 10) * !n))
@if !n < 5
:color= !base_color + (!n * #111)