I hereby claim:
- I am jensendarren on github.
- I am jensendarren (https://keybase.io/jensendarren) on keybase.
- I have a public key ASCUxtscnfGIjSlMCwIboYoEa2sGTmteWlwklL9PgF72xAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
# Add this to your ~/.bashrc file then run `source ~/.bashrc` | |
alias gs='git status ' | |
alias ga='git add ' | |
alias gb='git branch ' | |
alias gc='git commit' | |
alias gd='git diff' | |
alias gg='git grep -i' | |
alias go='git checkout ' |
if test "$#" = 0; then | |
( | |
git diff | |
git ls-files --others --exclude-standard | | |
while read -r i; do git diff -- /dev/null "$i"; done | |
) | |
else | |
git diff "$@" | |
fi |
require 'uri' | |
require 'open-uri' | |
google_url = "http://google.com/" | |
url = URI.parse(google_url) | |
# Get the hostname | |
puts "The hostname is #{url.hostname}" |
# Restrict arguments to a specified class. | |
require 'optparse' | |
class HelloParser | |
def self.parse(args) | |
options = {} | |
opts = OptionParser.new do |opts| | |
opts.banner = "Usage: name" | |
opts.on('-n', '--name NAME', 'The name of the person to say hello to') do |name| |
# http://www.ruby-doc.org/stdlib-2.1.0/libdoc/logger/rdoc/Logger.html | |
require 'logger' | |
class CoffeeShop | |
attr_reader :logger | |
def initialize(name) | |
@name = name | |
@menu = [] | |
@logger = Logger.new(STDOUT) |
require 'logger' | |
class CoffeeShop | |
attr_reader :std_logger, :file_logger | |
def initialize(name) | |
@name = name | |
@menu = [] | |
@std_logger = Logger.new(STDOUT) | |
@file_logger = Logger.new('./coffee_shop.log') |
require 'fileutils' | |
# __FILE__ keyword in ruby | |
puts "The current ruby file being executed is #{__FILE__}" | |
# Gets the directory name of the file being executed | |
current_directory = File.dirname(__FILE__) | |
puts "The current directory is #{current_directory}" | |
# expands to reveal the pwd (Present working directory) |
require 'benchmark' | |
# Compare sorting a Hash with an Array | |
arr = [] | |
hash = {} | |
10_000.times.with_index do |i| | |
ascii_code = rand(255) | |
random_char = ascii_code.chr | |
arr << random_char |
require 'observer' | |
class CoffeeShop | |
include Observable | |
attr_reader :customers | |
def initialize(name, capacity) | |
@name = name | |
@capacity = capacity | |
@customers = [] |