Skip to content

Instantly share code, notes, and snippets.

View markoa's full-sized avatar

Marko Anastasov markoa

View GitHub Profile
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@dhh
dhh / gist:1014971
Created June 8, 2011 18:09
Use concerns to keep your models manageable
# autoload concerns
module YourApp
class Application < Rails::Application
config.autoload_paths += %W(
#{config.root}/app/controllers/concerns
#{config.root}/app/models/concerns
)
end
end
@rcmachado
rcmachado / html5.vim
Created December 15, 2009 10:35
Vim syntax file for HTML 5
" Vim syntax file
" Language: HTML (version 5)
" Maintainer: Rodrigo Machado <rcmachado@gmail.com>
" URL: http://gist.github.com/256840
" Last Change: 2010 Aug 26
" License: Public domain
" (but let me know if you liked it :) )
"
" Note: This file just adds the new tags from HTML 5
" and don't replace default html.vim syntax file
@agibralter
agibralter / gist:430807
Created June 8, 2010 23:41
a hack so facebooker doesn't cause cucumber steps to explode if using rack 1.1.0
ActionController::Integration::Session.class_eval do
def generic_url_rewriter
env = {
'REQUEST_METHOD' => "GET",
'QUERY_STRING' => "",
"REQUEST_URI" => "/",
"HTTP_HOST" => host,
"SERVER_PORT" => https? ? "443" : "80",
"HTTPS" => https? ? "on" : "off",
"rack.input" => "wtf"
@markoa
markoa / bash_contour.sh
Last active September 27, 2016 12:58
Stuff I usually need in ~/.bash_profile
set -o vi
eval `ssh-agent`
ssh-add ~/.ssh/id_rsa
export PS1="\w ★ "
export LANGUAGE="en"
export LANG="C"
export LC_MESSAGES="C"
@michel
michel / download_chromium.sh
Created March 17, 2011 10:34
Download and install latest Chromium build on OS X. For a quick install run the following command in your console: curl https://gist.github.com/raw/874137/2f045246310587f5384c9db57e62f049e89ffbc6/download_chromium.sh > download_chromium.sh; chmod +x down
#!/bin/bash
BASEDIR=http://build.chromium.org/f/chromium/snapshots/Mac
mkdir -p /tmp/chromium_nightly
cd /tmp/chromium_nightly
echo "Downloading number of latest revision"
REVNUM=`curl -# $BASEDIR/LATEST`
echo "Found latest revision number $REVNUM, starting download"
@markoa
markoa / kata-two-binary-seach-spec.rb
Created January 19, 2011 08:37
Specification for a binary search method.
# Source: http://codekata.pragprog.com/2007/01/kata_two_karate.html
#
# Method takes an integer search target and a sorted array of integers.
# It should return the integer index of the target in the array, or -1
# if the target is not in the array.
#
# Test data:
def test_chop
assert_equal(-1, chop(3, []))