Skip to content

Instantly share code, notes, and snippets.

@NeilHanlon
NeilHanlon / compact_print_r.php
Created Oct 30, 2015
Prints compacted human-readable information about a variable. Follows nearly the same behavior as PHP's built-in function print_r with some improvements that reduce unnecessary indentation and lines.
View compact_print_r.php
<?php
/**
* Prints compacted human-readable information about a variable. Follows nearly
* the same behavior as PHP's built-in function print_r with some improvements.
* Namely, it reduces the output indentation for nested arrays and object,
* removes lines with a single parenthesis (open or close), and returns string
* representating boolean ("true" versus "false") when expression is a scalar
* boolean. Requires PHP 5.4 or greater due to shorthand array syntax.
*
View powerline-test.sh
#!/bin/bash
echo -e "Powerline glyphs:\n\
Code points Glyphe Description Old code point
U+E0A0 \xee\x82\xa0 Version control branch (U+2B60 \xe2\xad\xa0 )\n\
U+E0A1 \xee\x82\xa1 LN (line) symbol (U+2B61 \xe2\xad\xa1 )\n\
U+E0A2 \xee\x82\xa2 Closed padlock (U+2B64 \xe2\xad\xa4 )\n\
U+E0B0 \xee\x82\xb0 Rightwards black arrowhead (U+2B80 \xe2\xae\x80 )\n\
U+E0B1 \xee\x82\xb1 Rightwards arrowhead (U+2B81 \xe2\xae\x81 )\n\
U+E0B2 \xee\x82\xb2 Leftwards black arrowhead (U+2B82 \xe2\xae\x82 )\n\
View gist:6272641190cc90c073a7
POST /ssls
params { domain: example.com,
email_address: admin@example.com,
billing_customerid: WHMCS user ID,
billing_serviceid: WHMCS service ID (i.e, hosting),
billing_addonid: WHMCS addon ID under above service ID }
returns { status, message, alphassl_orderid }
GET /ssls/{alphassl_orderid}
View gist:d54888fdaf7885ccd031
POST /ssls
params { domain: example.com,
email_address: admin@example.com,
billing_customerid: WHMCS user ID,
billing_serviceid: WHMCS service ID (i.e, hosting),
billing_addonid: WHMCS addon ID under above service ID }
returns { status, message, alphassl_orderid }
GET /ssls/{alphassl_orderid}
View gist:095495e5ea8bef2e3f2f
POST /ssls
params { domain: example.com,
email_address: admin@example.com,
billing_customerid: WHMCS user ID,
billing_serviceid: WHMCS service ID (i.e, hosting),
billing_addonid: WHMCS addon ID under above service ID }
returns { status, message, alphassl_orderid }
GET /ssls/{alphassl_orderid}
View gist:7c21396d0b64ce01e15e
POST /ssls
params { domain: example.com,
email_address: admin@example.com,
billing_customerid: WHMCS user ID,
billing_serviceid: WHMCS service ID (i.e, hosting),
billing_addonid: WHMCS addon ID under above service ID }
returns { status, message, alphassl_orderid }
GET /ssls/{domain}
View logstash-suse
#! /bin/sh
### BEGIN INIT INFO
# Provides: logstash
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
### END INIT INFO
View inhouse.js
(function(){
var oldPrint = window.print;
var slice = Array.prototype.slice;
window.print = function () {
if (typeof window.onbeforeprint === "function") {
window.onbeforeprint.apply(this, slice.call(arguments));
}
oldPrint.apply(this, slice.call(arguments));
if (typeof window.onafterprint === "function") {