Skip to content

Instantly share code, notes, and snippets.

View heycarsten's full-sized avatar

Carsten Nielsen heycarsten

View GitHub Profile
# I was thinking about it, and thought if you were going to do "mixins" in Haml
# then they ought to work in a predictable way. In ERB you can simply define a
# method and place more ERB inside of it. This does not work in Haml, but maybe
# it should.
require 'sinatra'
require 'haml'
get '/erb' do
erb :test_erb
=begin
License: latest LGPL :D
As per my discussion with Gianni (@gf3),
http://twitter.com/phillmv/status/2659984348
http://twitter.com/phillmv/status/2660026344
http://twitter.com/phillmv/status/2660059102
http://twitter.com/phillmv/status/2660184885
http://twitter.com/phillmv/status/2660283856 and
http://twitter.com/phillmv/status/2660306850
parse_git_branch() {
RSLT=''
GIT_BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' | awk '{print $2}'`
if [ "$GIT_BRANCH" ]
then
GIT_STATUS=`git status 2> /dev/null | grep 'working directory clean'`
CLR='2'
if [ "$GIT_STATUS" ]
then
CLR='2'
require 'open-uri'
labe = open("http://en.wikipedia.org/wiki/Labe").read
usa = open("http://en.wikipedia.org/wiki/USA").read
puts labe
puts "\n\n\n"
puts usa