Skip to content

Instantly share code, notes, and snippets.

Sally Park sally

  • UC Berkeley
  • San Francisco, CA
Block or report user

Report or block sally

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View .bash_profile new
# 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 Feb 14, 2017
apple system default changes
View defaults.sh
# 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
View .gemrc
gem: --no-rdoc --no-ri
View .railsrc
# .railsrc
-B #Skip Bundle
-T #Skip Test-Unit
-d postgresql #Use postgres
View .gitconfig
[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"]
View .bash_profile
# 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 Jan 31, 2017
Hustle Interview Question (Conway's GoL recolor)
View hustling_simulator.rb
## 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 / max_time.rb
Created Jan 5, 2017
Chipmunks Career Week Algo Problem 3
View max_time.rb
# Given four digits, find the maximum valid time that can be displayed on a digital clock (in 24-hour format) using those digits. For example, given digits 1,8,3,2 the maxium valid time is "23:18".
# Note that "28:31" is not a valid time.
# Write a function that, given four integers A,B,C,D, returns the maximimum valid time in string format "HH:MM" or "NOT POSSIBLE" if it is not possible to display a valid time.
# For example, given 1,8,3,2, the function should return "23:18".
# Given 2,4,0,0 the function should return "20:40".
@sally
sally / reverse_vowels.rb
Created Jan 5, 2017
Chipmunks Career Week Algo Problem 2
View reverse_vowels.rb
# 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 Jan 5, 2017
Chipmunks Career Week Algo Problem 1
View longest_consecutive_increasing.rb
# 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
###################################
You can’t perform that action at this time.