Skip to content

Instantly share code, notes, and snippets.

Avatar

Marko Anastasov markoa

View GitHub Profile
@markoa
markoa / bash_contour.sh
Last active Sep 27, 2016
Stuff I usually need in ~/.bash_profile
View bash_contour.sh
set -o vi
eval `ssh-agent`
ssh-add ~/.ssh/id_rsa
export PS1="\w ★ "
export LANGUAGE="en"
export LANG="C"
export LC_MESSAGES="C"
@jimbojsb
jimbojsb / gist:1630790
Created Jan 18, 2012
Code highlighting for Keynote presentations
View gist:1630790

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 Jun 8, 2011
Use concerns to keep your models manageable
View gist:1014971
# autoload concerns
module YourApp
class Application < Rails::Application
config.autoload_paths += %W(
#{config.root}/app/controllers/concerns
#{config.root}/app/models/concerns
)
end
end
@michel
michel / download_chromium.sh
Created Mar 17, 2011
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
View download_chromium.sh
#!/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 Jan 19, 2011
Specification for a binary search method.
View kata-two-binary-seach-spec.rb
# 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, []))
@agibralter
agibralter / gist:430807
Created Jun 8, 2010
a hack so facebooker doesn't cause cucumber steps to explode if using rack 1.1.0
View gist:430807
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"
@rcmachado
rcmachado / html5.vim
Created Dec 15, 2009
Vim syntax file for HTML 5
View html5.vim
" 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