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
#!/bin/sh | |
# because gconftool doesn't have "append" | |
glist_append() { | |
local type="$1"; shift | |
local key="$1"; shift | |
local val="$1"; shift | |
local entries="$( | |
{ |
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
git config --global push.default simple | |
git config --global credential.helper 'cache --timeout=3600' |
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
postgres: postgres -D db/postgres |
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
git config --global push.default simple | |
git config --global credential.helper osxkeychain |
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
git config --global alias.c 'commit -m' | |
git config --global alias.st 'status --short --branch' | |
git config --global alias.ca 'commit --amend --reuse-message=HEAD' | |
git config --global alias.co 'checkout' | |
git config --global alias.br 'branch' | |
git config --global alias.df 'diff HEAD' | |
git config --global alias.ir $'!sh -c \'git rebase --interactive ${1-master}\' -' | |
git config --global alias.ll 'log --graph --all --pretty=format:"%Cred%h %>(11,trunc)%Cgreen%cr %<(10,trunc)%Cblue%cn%C(yellow)%d %Creset%s"' | |
git config --global alias.la 'log --patch --stat --pretty=format:"%C(bold red)%h %Cgreen%cr %Cblue%cn%C(yellow)%d %Creset%s"' | |
git config --global alias.dfs 'diff --staged' |
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
IRB.conf[:PROMPT_MODE] = :SIMPLE | |
IRB.conf[:AUTO_INDENT] = true |
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
class ResourcesController < ApplicationController | |
# GET /resources | |
def index | |
@resources = Resource.all | |
end | |
# GET /resources/1 | |
def show | |
@resource = Resource.find(params[:id]) | |
end |
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
# POST /articles | |
def create | |
@article = Article.new(article_params) | |
if @article.save | |
redirect_to @article, notice: 'Article was successfully created.' | |
else | |
render :new | |
end | |
end |
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
# generic literal of symbols | |
<:earth, :wind, :fire> | |
# => Set.new [:earth, :wind, :fire] | |
# %e literal of symbols without interpolation | |
%e<earth wind fire> | |
# => Set.new [:earth, :wind, :fire] | |
# %E literal of symbols with interpolation | |
element = :wind |
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
#!/usr/bin/env ruby | |
# | |
# Shorten a GitHub URL to a git.io URL | |
# v1.2.0 - Copyright (c) 2016 Ryan Sobol - The MIT License | |
# | |
# Usage: gitio URL [code] | |
# | |
# Examples: | |
# $ gitio https://github.com/ryansobol ryansobol | |
# https://git.io/ryansobol |