Skip to content

Instantly share code, notes, and snippets.

View mattcantstop's full-sized avatar

Matt Duff mattcantstop

View GitHub Profile
### Keybase proof
I hereby claim:
* I am mattcantstop on github.
* I am mattcantstop (https://keybase.io/mattcantstop) on keybase.
* I have a public key ASAqeVr61ruTc_uRcoemK8PG90gKsmL1Fc9DEfSgDv1o8go
To claim this, I am signing this object:
@mattcantstop
mattcantstop / sVimrc
Created April 20, 2017 21:16
sVimPreferences
let blacklists = ["*://youtube.com/*", "*://mail.google.com/*"]
fruits = ["apple","rice","pizza","orange"]
fruits.each do |food_item|
if food_item == "apple" or food_item == "orange"
puts "I like to eat fruit"
else
puts "I like to eat #{food_item}"
end
end
@mattcantstop
mattcantstop / terminal_prompt_git_repo_colored
Last active December 28, 2015 17:39
terminal prompt with color coded git repo based on branch status
git_branch () {
if git rev-parse --git-dir >/dev/null 2>&1
then echo -e "" [$(git branch 2>/dev/null| sed -n '/^\*/s/^\* //p')]
else
echo ""
fi
}
function git_color {
local STATUS=`git status 2>&1`
if [[ "$STATUS" == *'Not a git repository'* ]]
@mattcantstop
mattcantstop / time_parser
Created October 3, 2013 02:13
A way to drill down and see how much time has expired between two timestamps (integer).
module Duration
def self.calculate(duration)
times = {years: 31536000, months: 2678400, days: 86400, hours: 3600, minutes: 60, seconds: 1}
response = ''
duration = duration
times.each do |time, value|
numerator = duration / value if duration >= value
duration = duration % value if numerator
response << "#{numerator} #{time} " if numerator
@mattcantstop
mattcantstop / gist:5486624
Last active December 16, 2015 19:39 — forked from bylatt/gist:4971506
# GENERAL ALIASES
alias ls='ls -Glah'
alias chrome='open /Applications/Google\ Chrome.app'
alias mail='open -a Mail.app'
alias todo='open -a Reminders.app'
# BUNDLE
alias b='bundle'
alias s='bundle exec rails s'
@mattcantstop
mattcantstop / index.html
Created December 20, 2012 22:16
A CodePen by Joshua Hibbert. Single Element Pure CSS MacBook Pro - This is just an experiment! There are certainly better ways to show an image of a MacBook, but none as fun as this :)
<i class="macbook"></i>