Skip to content

Instantly share code, notes, and snippets.

View jonathanbardo's full-sized avatar

Jonathan Bardo jonathanbardo

View GitHub Profile
@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 ) {
@jonathanbardo
jonathanbardo / email.php
Last active August 29, 2015 14:16
Send email using WordPress
function smtp_mail( $phpmailer ) {
// Define that we are sending with SMTP
$phpmailer->isSMTP();
// The hostname of the mail server
$phpmailer->Host = YOURHOST;
// Use SMTP authentication (true|false)
$phpmailer->SMTPAuth = true;
// SMTP port number normally 25
$phpmailer->Port = '25';
// Username to use for SMTP authentication
@jonathanbardo
jonathanbardo / beforePS1.sh
Last active August 29, 2015 14:16
GIT PS1
#!/usr/bin/env bash
function BEFORE_PS1 {
printf "\e[32m[\e[0m$(whoami)\e[32m]@[\e[0mlocal\e[32m][\e[0m${PWD/#$HOME/~}\e[32m]$(gitPS1)\e[0m"
}
@jonathanbardo
jonathanbardo / .htaccess
Last active August 29, 2015 14:15 — forked from brichards/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteRule ^(.*\.(png|gif|jpg|jpeg)) http://example.com/$1 [NC,P,L]
</IfModule>
@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; }