Skip to content

Instantly share code, notes, and snippets.

Nicolas nmyers

Block or report user

Report or block nmyers

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
nmyers /
Created May 10, 2019
Patch permission changes
git diff -p -R --no-color \
| grep -E "^(diff|(old|new) mode)" --color=never \
| git apply
nmyers /
Created Jun 1, 2018 — forked from raquelmsmith/
How to install WP-CLI on WebFaction

I had difficulty installing WP-CLI properly on my WebFaction server because of the inability to use the sudo command to move the .phar file to the proper wp directory. The WebFaction support team was helpful as usual with some good instructions.

  1. Log in to your WebFaction account via SSH:
  2. Run the following command on the root directory: curl -so ~/bin/wp It's probably a good idea to check the download URL there with the official WP-CLI installation instructions to make sure it hasn't changed.
  3. Run the following command: chmod u+x ~/bin/wp
  4. Check to make sure it's installed correctly with wp --info.
nmyers /
Last active Jun 1, 2018 — forked from aliang/Mac SSH Autocomplete
Add auto complete to your ssh, put into your .bash_profile - Mac SSH Autocomplete
_complete_ssh_hosts ()
comp_ssh_hosts=`cat ~/.ssh/known_hosts | \
cut -f 1 -d ' ' | \
sed -e s/,.*//g | \
grep -v ^# | \
uniq | \
grep -v "\[" ;
nmyers /
Last active Jun 1, 2018
Adding local ssh key to authorized key on a remote server
cat ~/.ssh/ | ssh 'cat >> .ssh/authorized_keys'
nmyers / .htaccess
Created Apr 6, 2018
redirect images to another server .htaccess #htaccess #wordpress
View .htaccess
# local settings
RewriteEngine On
RewriteRule ^(wp-content/uploads/.*)$1 [L]
nmyers / functions.php
Created Mar 6, 2018
Custom tinymce editor wordpress #wp
View functions.php
function custom_tiny_mce( $settings ) {
$settings['toolbar1'] = 'styleselect,bold,italic,bullist,blockquote,hr,alignleft,aligncenter,link,unlink';
$style_formats = array(
'title' => 'Content Block',
'block' => 'span',
'classes' => 'content-block',
'wrapper' => true,
nmyers /
Last active Mar 6, 2018
Wordpress menu with icons #wp

Menu icons block

nmyers /
Created Jun 23, 2017
Get files only from gist
git clone --depth 1 social-share; cd social-share ; rm -rf .git
View inc-social-share.php
function add_opengraph_markup() {
if (is_single()) {
global $post;
$twitter_handle = '';
$image = get_image(get_field('main_image'),'692x410');
$description = substr(strip_tags($post->post_content),0,200) . '...';
<meta property="og:title" content="<?php the_title(); ?>" />
nmyers / fluidbricks.js
Last active Aug 29, 2015
Fuidbricks - basic masonry alternative
View fluidbricks.js
* Requires imagesLoaded
(function($) {
$.fluidbricks = function(element, options) {
var defaults = {
'itemClass': '.element',
You can’t perform that action at this time.