Skip to content

Instantly share code, notes, and snippets.

#!bash
#
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
# Enable directory and file color highlighting
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagacad
# Common aliases
alias rm='rm -i'
alias ll='ls -l'
alias la='ls -a'
alias vi='vim'
@jules27
jules27 / .vimrc
Created September 11, 2013 04:11
vimrc
set nocompatible
set hidden
set hlsearch
set wildmenu
set ruler
syntax on
set expandtab
autocmd BufNewFile,BufRead Gemfile set filetype=ruby
@jules27
jules27 / speech_hacker_schema.xml
Created December 6, 2012 21:18
Database Schema for Speech Hacker
<?xml version="1.0" encoding="utf-8" ?>
<!-- SQL XML created by WWW SQL Designer, http://code.google.com/p/wwwsqldesigner/ -->
<!-- Active URL: http://socrates.devbootcamp.com/sql -->
<sql>
<datatypes db="mysql">
<group label="Numeric" color="rgb(238,238,170)">
<type label="Integer" length="0" sql="INTEGER" re="INT" quote=""/>
<type label="Decimal" length="1" sql="DECIMAL" re="DEC" quote=""/>
<type label="Single precision" length="0" sql="FLOAT" quote=""/>
<type label="Double precision" length="0" sql="DOUBLE" re="DOUBLE" quote=""/>
# 3 versions of Ruby installed
jmao$ rvm list
rvm rubies
ruby-1.8.7-p352 [ i686 ]
ruby-1.9.2-p290 [ x86_64 ]
=* ruby-1.9.3-p194 [ x86_64 ]
# => - current
@jules27
jules27 / ruby_end_keyword.md
Last active October 13, 2021 14:46
Using the "end" keyword in Ruby

Introduction

After working through exercises for learning Ruby as part of preparation for the upcoming Dev Bootcamp (note: no longer exists), we had a friendly discussion about the exercise to implement a Reverse Polish notation calculator. At the end of discussion, one of the staff members, Jesse, posted his solution to students.

The solution is well-designed, clean, and easy to read. However, one line of code caught my eye:

tokenize(array).inject([]) do |stack, token|
      <...>
end.pop