Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Marcus Shepherd marcusshepp

🎯
Focusing
View GitHub Profile
@marcusshepp
marcusshepp / remote_pop.sh
Created May 30, 2019
pop last commit from remote
View remote_pop.sh
# pop one commit from remote master
# '+' pushes with force
git push origin +HEAD^:master
@marcusshepp
marcusshepp / ref.cs
Created May 8, 2019
Passing a var by reference in C#
View ref.cs
using System;
public class Program
{
public static void Main()
{
bool foo = false;
Console.WriteLine("foo 1: ");
Console.WriteLine(foo);
changeFoo(ref foo);
@marcusshepp
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; }
}
View windowspowershell.md

powershell

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
marcusshepp / git_add_rm_files.sh
Last active Dec 7, 2017
staging deleted files by listing them then sending the list into git rm
View git_add_rm_files.sh
git rm $(git ls-file --deleted);
@marcusshepp
marcusshepp / reset-file.sh
Created Aug 29, 2017
reset file back to commit hash
View reset-file.sh
git checkout c5f567 -- file1/to/restore file2/to/restore
@marcusshepp
marcusshepp / f-br.sh
Created Aug 24, 2017
finding branches
View f-br.sh
# to fetch (obtain references to) all origin branches
git fetch origin
# to see all branches
git branch -a
git branch -a | grep foo
@marcusshepp
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)
Rails.logger.info(s)
end
File.open("debug.txt", ""){|f|f.write('foo')}
raise "foo"
View show_untracked_files.sh
git ls-files --others --exclude-standard
@marcusshepp
marcusshepp / files-changed.sh
Created Aug 21, 2017
git diff list only names of files changed
View files-changed.sh
git diff --name-only
You can’t perform that action at this time.