Skip to content

Instantly share code, notes, and snippets.

# echo is like puts for bash (bash is the program running in your terminal)
echo "Loading ~/.bash_profile a shell script that runs in every new terminal you open"
# $VARIABLE will render before the rest of the command is executed
echo "Logged in as $USER at $(hostname)"
# Load git completions
git_completion_script=/usr/local/etc/bash_completion.d/git-completion.bash
test -s $git_completion_script && source $git_completion_script
@sally
sally / defaults.sh
Last active February 14, 2017 16:38
apple system default changes
# Make TabWidth be 2 in TextEdit
defaults write com.apple.TextEdit "TabWidth" '2'
# Turn off automatic double dash into em dash substitution
defaults write -g NSAutomaticDashSubstitutionEnabled 0
# Turn off smart quotes
defaults write -g NSAutomaticQuoteSubstitutionEnabled 0
@sally
sally / .gemrc
Created February 14, 2017 16:37
gem: --no-rdoc --no-ri
# .railsrc
-B #Skip Bundle
-T #Skip Test-Unit
-d postgresql #Use postgres
@sally
sally / .gitconfig
Last active February 12, 2017 04:42
[core]
# Excludesfiles allows us to set a global list of things to ignore
excludesfile = ~/.gitignore_global
# These are custom color options for the console
[color]
status = auto
diff = auto
[color "status"]
# echo is like puts for bash (bash is the program running in your terminal)
echo "Loading ~/.bash_profile a shell script that runs in every new terminal you open"
# $VARIABLE will render before the rest of the command is executed
echo "Logged in as $USER at $(hostname)"
# Load RVM into a shell session *as a function*
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
# Path for RVM
test -d $HOME/.rvm/bin && PATH=$PATH:$HOME/.rvm/bin
@sally
sally / hustling_simulator.rb
Last active January 31, 2017 17:03
Hustle Interview Question (Conway's GoL recolor)
## Problem statement:
# Building meaningful relationships is a delicate balance. When hustlers have too many relationships they can get burned out. When they have too little, they are ineffective at achieving meaningful outcomes. When they hustle the right amount, they are successful at achieving their goals and in recruiting others to do the same.
# Hustle wants help modeling these relationship interactions using a two-dimensional grid of cells, each of which is in one of two possible states, hustling or not-hustling.
# Hustlers interact with people around them, the cells that are horizontally, vertically, or diagonally adjacent to them in the the following ways:
# Any hustler with fewer than two hustling neighbors gives up and stops hustling. There were not enough relationships to achieve their goals.
# Any hustler with two or three hustling neighbors keeps on hustling.
# Any hustler with more than three hustling neighbors stops hustling.
# Any non-hustler with exactly three hustling neighbours becomes a hu
@sally
sally / reverse_vowels.rb
Created January 5, 2017 22:38
Chipmunks Career Week Algo Problem 2
# Write a function that takes a string as input and reverse only the vowels of a string.
#
# Example 1:
# Given s = "hello", return "holle".
#
# Example 2:
# Given s = "leetcode", return "leotcede".
#
# Note:
# The vowels does not include the letter "y".
@sally
sally / longest_consecutive_increasing.rb
Created January 5, 2017 22:36
Chipmunks Career Week Algo Problem 1
# SP: Find the length of the longest subarray within an array which has consecutive, increasing numbers.
# Example input: [1,2,3,5]
# Example output: 3
# Example input: [44, 11, 12, 9]
# Example output: 2
###################################