Skip to content

Instantly share code, notes, and snippets.


Marcus Shepherd marcusshepp

Block or report user

Report or block marcusshepp

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
marcusshepp /
Created May 30, 2019
pop last commit from remote
# pop one commit from remote master
# '+' pushes with force
git push origin +HEAD^:master
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: ");
changeFoo(ref foo);


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 / 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; }
marcusshepp / js_notes.js
Last active Dec 17, 2017
Javascript Arrays
View js_notes.js
// javascript's foreach is cool
let arr = new Array();
for (let i = 0; i < 5; i++){
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 /
Last active Dec 6, 2017
My Vim Cheat Sheet


  • replace current file with new file: :e path/to/file
  • undo: u
  • redo: ctrl r
  • increment/decrement number: CTRL A, CTRL X
  • change case: ~
  • change case of full word: viw~
  • join two lines: J
  • fix line indent: ==
  • indent/unindent block (vis m): >/</5<
grep "4294" -B 3 -A 3
grep -r "foo" .
# -H causes the filename to be printed (implied when multiple files are searched)
# -r does a recursive search
# -n causes the line number to be printed
# -I ignore binary files (complement: -a treat all files as text)
# -F treat search term as a literal, not a regular expression
# -i do a case-insensitive search
marcusshepp /
Last active Nov 9, 2017
changing the permissions level of a folder
sudo chown -R $USER ~/projects/kaa-api/log
View rails_queries.rb
# rails 2.3.5
p = Promotion.find(:first, :conditions => ["subdomain = ?", "foobar"])
# to find based on multiple conditions based on multiple associations
User.find(:all, :include => [:contact, :promotion], :conditions => [' = ? and = ?', '', 22])
# to find last record in old rails apps, rails 2
p = Promotion.find(:all, :order => "id desc", :limit => 1) # newest first
# and in ascending order
p = Promotion.find(:all, :order => "id asc", :limit => 1) # oldest first
You can’t perform that action at this time.