Skip to content

Instantly share code, notes, and snippets.

@delputnam
delputnam / .editorconfig
Last active July 1, 2020 18:09
Del's phpstorm .editorconfigfile
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
max_line_length = 120
tab_width = 4
trim_trailing_whitespace = true
ij_continuation_indent_size = 8
svn status --ignore-externals | grep ! | tr -s ' ' | cut -d ' ' -f2 | xargs svn rm

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
openssl genrsa -out private.pem 2048
openssl rsa -in private.pem -outform PEM -pubout -out public.pem
@delputnam
delputnam / gist:497ee68b4f2df9301ba4eb9753fb0b0f
Created May 10, 2017 14:32
svn remove unversioned files
svn status | grep ^\? | cut -c9- | xargs -d \\n rm -r
@delputnam
delputnam / gist:40c4c777707c292cf8f961663770d58d
Created April 28, 2017 14:49
save and apply svn diffs locally
svn diff > ~/my-awesome-diff.diff
patch -p0 < ~/my-awesome-diff.diff
@delputnam
delputnam / gist:8213bbe304b9ffbdcfc28f5d6b083e8c
Last active December 15, 2022 19:29
Remove all unison .tmp files
find . -name "*.unison.tmp" -delete
@delputnam
delputnam / jetpack-test.php
Last active January 23, 2018 20:16
A simple WordPress plugin to allow testing of Jetpack's Related Posts module
<?php
/**
* @package Jetpack_Test
* @version 1.0
*/
/*
Plugin Name: Jetpack Test
Description: Allows certain Jetpack modules that would otherwise require a connection to WordPress.com to be run in a local development environment.
Author: Del Putnam
@delputnam
delputnam / happy_git_on_osx.md
Created January 17, 2017 18:42 — forked from trey/happy_git_on_osx.md
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global user.name "Your Name"

git config --global user.email "you@example.com"

@delputnam
delputnam / gist:ece1350f6079225cc5de3acfee526059
Created January 6, 2017 12:10
Get paths of all image sizes for post attachments
$args = array(
'posts_per_page' => 1,
'order' => 'ASC',
'post_mime_type' => 'image',
'post_parent' => $post_id,
'post_status' => null,
'post_type' => 'attachment',
);
$attachments = get_children( $args );
foreach( $attachments as $attachment ) {