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
nmyers / patch-permissions.sh
Created May 10, 2019
Patch permission changes
View patch-permissions.sh
#see https://stackoverflow.com/questions/2517339/how-to-restore-the-permissions-of-files-and-directories-within-git-if-they-have
git diff -p -R --no-color \
| grep -E "^(diff|(old|new) mode)" --color=never \
| git apply
@nmyers
nmyers / webfaction-wp-cli.md
Created Jun 1, 2018 — forked from raquelmsmith/webfaction-wp-cli.md
How to install WP-CLI on WebFaction
View webfaction-wp-cli.md

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: https://docs.webfaction.com/user-guide/access.html
  2. Run the following command on the root directory: curl -so ~/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar 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
nmyers / bash_profile.sh
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
View bash_profile.sh
_complete_ssh_hosts ()
{
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
comp_ssh_hosts=`cat ~/.ssh/known_hosts | \
cut -f 1 -d ' ' | \
sed -e s/,.*//g | \
grep -v ^# | \
uniq | \
grep -v "\[" ;
@nmyers
nmyers / addkey.sh
Last active Jun 1, 2018
Adding local ssh key to authorized key on a remote server
View addkey.sh
cat ~/.ssh/id_rsa.pub | ssh opinium@opinium.webfactional.com 'cat >> .ssh/authorized_keys'
@nmyers
nmyers / .htaccess
Created Apr 6, 2018
redirect images to another server .htaccess #htaccess #wordpress
View .htaccess
# local settings
RewriteEngine On
RewriteRule ^(wp-content/uploads/.*) https://lansons.com/$1 [L]
@nmyers
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(
array(
'title' => 'Content Block',
'block' => 'span',
'classes' => 'content-block',
'wrapper' => true,
),
array(
@nmyers
nmyers / _wpb_menu-icons.md
Last active Mar 6, 2018
Wordpress menu with icons #wp
View _wpb_menu-icons.md

Menu icons block

@nmyers
nmyers / gist-get-files.sh
Created Jun 23, 2017
Get files only from gist
View gist-get-files.sh
git clone --depth 1 https://gist.github.com/d5d78fc32e458d309eab4fb89a258f1b.git social-share; cd social-share ; rm -rf .git
View inc-social-share.php
<?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
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.