Skip to content

Instantly share code, notes, and snippets.

View verticalgrain's full-sized avatar

Jamie Graham verticalgrain

View GitHub Profile
@verticalgrain
verticalgrain / jetpack-cheatsheet.txt
Created August 25, 2017 21:47
Jetpack Cheat Sheet
// Enable extra jetpack widgets:
wp-admin/admin.php?page=jetpack_modules
@verticalgrain
verticalgrain / style-directory.txt
Last active September 25, 2017 18:09
Style directory structure
styles
/includes
_base.scss
_fonts.scss
_functions.scss
_grid.scss
_mixins.scss
_normalize.scss
_typography-global.scss
_variables.scss
@verticalgrain
verticalgrain / Sublime.txt
Created August 21, 2017 19:23
Sublime text cheatsheet
// Search in files, excluding svn and css files
<open folders> ,-*.pack, ,-*.svn-base, ,-*.css
@verticalgrain
verticalgrain / picture-srcset.html
Created August 10, 2017 04:52
Picture srcset example
<picture>
<source srcset="http://placehold.it/1600x686" media="(min-width: 1779px)">
<source srcset="http://placehold.it/1600x600" media="(min-width: 1400px)">
<source srcset="http://placehold.it/1259x472" media="(min-width: 1084px)">
<source srcset="http://placehold.it/1083x609" media="(min-width:768px)">
<source srcset="http://placehold.it/767x431" media="(min-width:540px)">
<source srcset="http://placehold.it/539x303" media="(min-width:0)">
<img srcset="http://placehold.it/1259x472" src="http://placehold.it/1259x472" alt="Placeholder with grey background and dimension watermark without any imagery">
</picture>
@verticalgrain
verticalgrain / svn-cheatsheet.txt
Last active October 27, 2017 20:55
SVN Cheatsheet
// Clone an SVN repo
svn co https://repourl
// Info
svn info
// Update / pull
svn up
// Stat (status)
@verticalgrain
verticalgrain / helpful-links.php
Last active July 20, 2017 15:15
ACF Repeater in Wordpress Widget
@verticalgrain
verticalgrain / C.H.I.P. Cheatsheet
Last active November 8, 2017 21:57
C.H.I.P. Cheatsheet
// SSH over lan:
ssh [email protected]
OR:
ssh [email protected]
OR:
ssh [email protected]
// PASSWORD
chip
@verticalgrain
verticalgrain / SASS-SCSS-cheatsheet.txt
Last active September 21, 2017 15:51
SASS / SCSS Cheatsheet
// Compile SASS or SCSS once from the command line
// sass --update sass-directory:css-directory
sass --update sass:css
// Watch SASS or SCSS directory from the command line
// sass --watch sass-directory:css-directory
sass --watch sass:css
// Watch SASS or SCSS file from the command line
sass --watch sass/sass-file.scss:css/css-file.css
@verticalgrain
verticalgrain / Terminal Cheatsheet.txt
Last active May 14, 2019 22:19
Terminal Cheatsheet
// Identify a process on a specific port
-lsof -i :8890
// Kill process, by PID:
sudo kill 3456
// Kiill process, by port:
npx kill-port 3000
@verticalgrain
verticalgrain / wordpress-cheatsheet.php
Last active October 3, 2017 18:43
Wordpress cheatsheet
// TRANSLATION
// Translateable string, with escaping (in case there are special characters in one of the translations)
// This is the best choice since it catches and escapes any HTML that may be in the string
esc_html__( 'This is my string', 'translationdomain' );
esc_html_e( 'This is my string', 'translationdomain' );
// Retrieve the translation of a string
// Don't know why but apparently all three methods work
__( 'This is my string', 'translationdomain' )