Skip to content

Instantly share code, notes, and snippets.

@brandonratz
brandonratz / git modified no subdirectory
Created January 30, 2019 20:50
see modified files w/ no subdirectory #git
git diff --name-only | grep "^`git rev-parse --show-prefix`[^/]*$"
@brandonratz
brandonratz / cmd-commands
Last active December 29, 2018 02:14
CMD Commands
# Bang bang - repeats last command
!!
# Kill end of line, paste forward
ctrl + k & ctrl + y
img.desaturate {
-webkit-filter: grayscale(100%);
filter: grayscale(100%);
filter: gray;
filter: url("data:image/svg+xml;utf8,<svg version='1.1' xmlns='http://www.w3.org/2000/svg' height='0'><filter id='greyscale'><feColorMatrix type='matrix' values='0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0' /></filter></svg>#greyscale");
}
<?php
// Load the currently logged in user.
global $user;
// Check if the user has the 'editor' role.
if (in_array('editor', $user->roles)) {
// do fancy stuff
}
?>
@brandonratz
brandonratz / MARS---Role-Icons.markdown
Created June 16, 2014 20:40
A Pen by Brandon Ratzloff.
@brandonratz
brandonratz / A-Pen-by-Brandon-Ratzloff.markdown
Created February 25, 2014 19:48
A Pen by Brandon Ratzloff.