# declare the file as a bash script
#!/bin/bash
# debug a script
bash -x script.sh
# variables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Update your RVM to the latest statble version. | |
rvm get latest | |
# Update your RVM to the most recent version. (most bug fixes) | |
rvm get head | |
# Reinstall all your Rails gemset gems | |
rvm gemset empty project_gem_set && gem install bundler && bundle install | |
# How to fix Mac issue: `require': no such file to load -- iconv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Howebrew package manager for OS X is useful for installing unix terminal tools. | |
# Install Homebrew | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)" | |
# Install wget | |
brew install wget | |
brew install openssl | |
# Update homebrew and all your packages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# header | |
#!/usr/bin/env ruby | |
# require gem libraries | |
require 'rubygems' | |
require 'fileutils' | |
# get the current directory | |
dir = File.expand_path(File.dirname(__FILE__)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main(args: Array<String>) { | |
// when statement | |
val firstName = "Dan" | |
val job = when (firstName) { | |
"Dan", "Jay", "Philip" -> "programmer" | |
"Jamie" -> "designer" | |
else -> "boss" | |
} | |
println("$firstName is a $job") |