Skip to content

Instantly share code, notes, and snippets.

nicolasembleton /
Last active Jun 9, 2021
Restart Bluetooth Daemon on Mac OS X without restarting
sudo kextunload -b
sudo kextload -b
chrisdc / navigation.js
Last active Nov 2, 2018
Object Orientated navigation.js
View navigation.js
( function() {
function Menu( containerId, options ) {
var container,
function init() {
container = document.getElementById( containerId );
if ( ! container ) {

How to get Composer running on SiteGround shared

  1. Download to your account's home directory — /home/username.
  2. Edit .bashrc file in same directory by adding alias composer='/usr/local/php56/bin/php-cli ~/composer.phar' line. Update php56 part to current relevant version, if necessary.
  3. Restart SSH session or run source ~/.bashrc to reload config.
  4. Use composer command!
GaryJones / .csscomb.json
Last active Nov 2, 2018
[Replaced] CSSComb file for WP core.
View .csscomb.json
cfoellmann / tribe-events-activation-connector-oop.php
Last active Aug 29, 2015
Auto-(De-)Activate 'The Events Calendar' with 'The Events Calendar Pro' + hide 'The Events Calendar' from plugins.php listing
View tribe-events-activation-connector-oop.php
class EventsConnector {
var $events_calendar;
public function __construct() {
$this->events_calendar = 'the-events-calendar/the-events-calendar.php';
$events_calendar_pro = WP_PLUGIN_DIR . '/events-calendar-pro/events-calendar-pro.php';
GaryJones / functions.php
Last active Jan 11, 2016
Default styles for HTML5 galleries and captions.
View functions.php
add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' ) );
fxbenard /
Created Mar 5, 2014
Pull translations with Transifex client, create the mo and remove the po
#! /bin/sh
# Pull all files from Transifex;
# Minimum percentage change to whatever you want
tx pull -a --minimum-perc=100
# Create .mo files from .po files.
# Twisted by, created by grappler.
for file in `find . -name "*.po"` ; do msgfmt -o ${file/.po/.mo} $file && rm $file ; done
jrfnl / bccalc.php
Last active Oct 17, 2019
Do simple reliable math calculations without the risk of wrong results using bcmath
View bccalc.php
* Do simple reliable floating point calculations without the risk of wrong results.
* @see
* @see the big red warning on
* In the rare case that the bcmath extension would not be loaded, it will return the
* normal calculation results.
mpeshev /
Last active Dec 27, 2015
Theme Review Porto plan
nacin / auto-update.php
Last active Mar 11, 2019
This is how @dd32 and I test automatic background updates in WordPress 3.7. Then just do (If you use a checkout of, you can run this on the `build` directory, then simply run `grunt copy` between updates to copy over the latest code from `src`. This is how we are able to make adjustmen…
View auto-update.php
// Add this as a mu-plugin.
if ( isset( $_GET['wp_maybe_auto_update'] ) ) {
add_filter( 'automatic_updates_is_vcs_checkout', '__return_false' );
add_action( 'template_redirect', function() {
$time = date( 'r' );
echo "Starting... $time<br />";
delete_site_option( 'auto_core_update_failed' );