Skip to content

Instantly share code, notes, and snippets.

<?php
function runlength_encode( string $str ) {
$ret = '';
$split_str = str_split( $str );
for ( $i = 0; $i < count( $split_str ); $i++ ) {
$num = 1;
# Copyright (C) 2017 BuddyPress Reply By Email
# This file is distributed under the same license as the BuddyPress Reply By Email package.
msgid ""
msgstr ""
"Project-Id-Version: BuddyPress Reply By Email 1.0-RC6.dev\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/bp-reply-by-"
"email\n"
"POT-Creation-Date: 2017-12-13 14:48:10+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
# easier vagrant interaction: automatically cds to the relative cwd on the guest (if applicable) and runs $* there
# e.g. p gulp; p composer update
run_on_vagrant() {
local hostname="$1"; shift
local command="$*"
local vagrant_dir=/Users/ryan/code/commons-playbooks/vagrant
local host_dir="$vagrant_dir/sync/$hostname"
local guest_dir=/srv/www/commons/current
local relative_guest_dir=. # if we're within the project this will be overwritten below, assume no cd to start
@modelm
modelm / private.xml
Created April 15, 2015 21:49
Karabiner configuration to control cmus with media keys on macbook (~/Library/Application Support/Karabiner/private.xml)
<?xml version="1.0"?>
<root>
<vkopenurldef>
<name>KeyCode::VK_OPEN_URL_SHELL_cmus_play</name>
<url type="shell">
<![CDATA[ /usr/local/bin/cmus-remote -u ]]>
</url>
</vkopenurldef>
<vkopenurldef>
<name>KeyCode::VK_OPEN_URL_SHELL_cmus_prev</name>