Skip to content

Instantly share code, notes, and snippets.

View csgavino's full-sized avatar

Carlos Gavino csgavino

View GitHub Profile
@csgavino
csgavino / calendar.js
Last active August 29, 2015 14:05
Calendar Kata in JavaScript.
module.exports = Calendar;
function Calendar(year, month, startOn) {
var year = year;
var month = month;
var startOn = startOn || 0;
var date = new Date(year, month - 1, 1);
function title() {
return ' ' + months()[date.getMonth()] + ' ' + date.getFullYear();
#!/bin/bash
say -v "Vicki" "Hello world."
@csgavino
csgavino / clock.rb
Created April 2, 2014 06:42
Shows you how much money you're wasting in this meeting.
require 'rspec'
class Clock
def initialize(minutes = 0)
@minutes = minutes
@cost = 0
end
def work_days; 22 end
def average_salary; 4000.0 end
@csgavino
csgavino / yo.sh
Last active December 23, 2015 18:59
install() {
echo -e "Installing $1\n"
brew install $*
}
curl https://gist.github.com/csgavino/6648410/raw -Lso ~/.bashrc
curl https://gist.github.com/csgavino/6648432/raw -Lso ~/.tmux.conf
curl https://gist.github.com/csgavino/6351486/raw -Lso ~/.vimrc
echo "source ~/.bashrc" >> ~/.bash_profile
set -g default-terminal "screen-256color"
set -g history-limit 20000
# reload config
unbind r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# horizontal and vertical splits
unbind |
bind | split-window -h
# Looks for the escaped fragment meta tag. If found, gets the HTML snapshot
# instead
module GoogleBotSimulator::EscapedFragment
def has_meta_fragment?
(@response.search('//meta[@name="fragment"]/@content').to_s == '!') ? true : false
end
def url_with_escaped_fragment(url)
#!/bin/bash
if [[ $# -gt 1 ]]; then
version=$1
echo $version > version.txt
echo "Bumped version to $version"
else
version=$(git describe --tags --always)
tokens=(${version//./ })
length=${#tokens[@]}
@csgavino
csgavino / vimrc
Last active December 21, 2015 18:59
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'altercation/vim-colors-solarized'
Plugin 'cakebaker/scss-syntax.vim'

Setting Up Clojure on OS X

I spent a lot of time trying to find a pretty optimal (for me) setup for Clojure… at the same time I was trying to dive in and learn it. This is never optimal; you shouldn't be fighting the environment while trying to learn something.

I feel like I went through a lot of pain searching Google, StackOverflow, blogs, and other sites for random tidbits of information and instructions.

This is a comprehensive "what I learned and what I ended up doing" that will hopefully be of use to others and act as a journal for myself if I ever have to do it again. I want to be very step-by-step and explain what's happening (and why) at each step.

Step 1: Getting Clojure (1.3)

sudo apt-get update
sudo apt-get install build-essential libssl-dev libreadline5 libreadline5-dev zlib1g zlib1g-dev sqlite3 libsqlite3-dev git-core
sudo apt-get install libxslt-dev libxml2-dev
# sudo apt-get install libmysqlclient-dev ruby-dev
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install imagemagick libmagickcore-dev libmagickwand-dev
sudo apt-get install libreadline-dev
### Install Java ###