Skip to content

Instantly share code, notes, and snippets.


Marcus Shepherd marcusshepp

View GitHub Profile
marcusshepp / mqu.css
Created Mar 15, 2019
media query for height and between two widths
View mqu.css
@mixin mobile-only--height {
@media (max-height: 635px) and (min-width: 642px) and (max-width: 1440px) { @content; }


create a new file with new-item

new-item -name 'foobar.txt' -itemtype file -path . -value 'foobarpop'

create a new directory with new-item

new-item -name 'foobar' -itemtype directory -path .

moving items with move-item

marcusshepp /
Last active Dec 7, 2017
staging deleted files by listing them then sending the list into git rm
git rm $(git ls-file --deleted);
marcusshepp /
Created Aug 29, 2017
reset file back to commit hash
git checkout c5f567 -- file1/to/restore file2/to/restore
marcusshepp /
Created Aug 24, 2017
finding branches
# to fetch (obtain references to) all origin branches
git fetch origin
# to see all branches
git branch -a
git branch -a | grep foo
marcusshepp / puts.rb
Created Aug 23, 2017
puts not working in rails project
View puts.rb
# puts string was not working, these are a few work arounds
def puts(s)
end"debug.txt", ""){|f|f.write('foo')}
raise "foo"
git ls-files --others --exclude-standard
marcusshepp /
Created Aug 21, 2017
git diff list only names of files changed
git diff --name-only
marcusshepp /
Last active Aug 21, 2017
git diff without white space
git diff -w # ignores whitespace differences
# note that this will see no difference in "asc" and "a s c"
git diff --ignore-space-at-eol # ignores all space at the end of line
# this is most likely what you want.
# these options also work with git show
git show 2ert4d9 --ignore-all-space
git show 2ert4d9 --ignore-space-change
marcusshepp /
Created Aug 9, 2017
suppressing the possible error of a command
git log @{u}.. 2> /dev/null
# if git log fails, it will fail silently.
# 2> means redirecting the output of stderr.
You can’t perform that action at this time.