Skip to content

Instantly share code, notes, and snippets.

View jonathanbardo's full-sized avatar

Jonathan Bardo jonathanbardo

View GitHub Profile
@jonathanbardo
jonathanbardo / plugin_extends.php
Last active February 11, 2016 01:20
Override/Extends a plugin
<?php
/**
* Plugin Name: Extend a plugin
* Version: 0.0.1
* Author: Jonathan Bardo
* License: GPLv2+
* Author URI: http://jonathanbardo.com
*/
if ( ! class_exists( 'Date_Range_Filter' ) ) {
@jonathanbardo
jonathanbardo / copy_jira_issue.js
Last active August 29, 2015 14:07
Copy Jira issue
var title = document.title;
var endOfIssueKeyIndex = title.indexOf("]");
var issueKey = title.substring("[".length, endOfIssueKeyIndex);
window.prompt("Copy to clipboard: CMD+C, Enter", issueKey);
@jonathanbardo
jonathanbardo / openvpn.md
Last active August 29, 2015 14:02 — forked from padde/openvpn.md

OpenVPN on Ubuntu 12.10 at DigitalOcean

Install OpenVPN

sudo apt-get install openvpn

Generate Server Certificates

sudo cp -r /usr/share/doc/openvpn/examples/easy-rsa/2.0 /etc/openvpn/easy-rsa2

cd /etc/openvpn/easy-rsa2

gitjira (){ git log $1...$2 | grep -o -E '\b([A-Z]+)-[0-9]+\b' | sort | uniq; }
[xdebug]
zend_extension="xdebug.so"
xdebug.remote_enable=1
xdebug.remote_connect_back=1
xdebug.default_enable=1
xdebug.remote_autostart=1
xdebug.remote_host=localhost
xdebug.remote_handler=dbgp
xdebug.remote_port=9000
xdebug.cli_color=1
@jonathanbardo
jonathanbardo / before.sh
Last active December 30, 2015 05:19
WP-CLI SSH
# Querying vagrant
$ cd ~/Sites/vvv/www/example.com/
$ vagrant ssh
$ cd /www/example.com/
$ wp plugin status
$ exit;
# Querying staging server
$ ssh root@awesome.staging.server
$ cd /www/example.com/
@jonathanbardo
jonathanbardo / WordPress.xml
Last active December 24, 2015 23:19 — forked from Rarst/deprecated.md
WordPress Coding Standard for PhpStorm
<?xml version="1.0" encoding="UTF-8"?>
<code_scheme name="WordPress">
<option name="USE_SAME_INDENTS" value="true" />
<option name="IGNORE_SAME_INDENTS_FOR_LANGUAGES" value="true" />
<option name="OTHER_INDENT_OPTIONS">
<value>
<option name="INDENT_SIZE" value="4" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="true" />
@jonathanbardo
jonathanbardo / Base16.icls
Last active December 24, 2015 18:49
PhpStorm Base 16 color scheme
<?xml version="1.0" encoding="UTF-8"?>
<scheme name="Base16" version="124" parent_scheme="Default">
<option name="LINE_SPACING" value="1.0" />
<option name="EDITOR_FONT_SIZE" value="14" />
<option name="EDITOR_FONT_NAME" value="Menlo" />
<colors>
<option name="ADDED_LINES_COLOR" value="295622" />
<option name="ANNOTATIONS_COLOR" value="8b999f" />
<option name="CARET_COLOR" value="bbbbbb" />
<option name="CARET_ROW_COLOR" value="" />
/**
* Trims text to a space then adds ellipses if desired
*
* @param string $input text to trim
* @param int $length in characters to trim to
* @param bool $ellipses if ellipses (...) are to be added
* @param bool $strip_html if html tags are to be stripped
* @return string
*/
function trim_text( $input, $length, $ellipses = true, $strip_html = true ) {