Skip to content

Instantly share code, notes, and snippets.

r-a-y /
Last active May 25, 2022 22:52 — forked from joshbarrass/
Python code to generate cue sheets (.cue files) from YouTube timestamps
A script for automatically generating CUE files from a list of timestamps and titles, like
those commonly seen in YouTube descriptions.
python --output="Filename without extension" "timestamps.txt" "Album name" "Artist name"
"timestamps.txt" should be a text file containing a list of timestamps and titles like:
00:00 Track 1
r-a-y /
Last active May 30, 2023 15:53
Using Git for Windows (PortableGit) with a portable HOME directory


I develop on Windows (yeah, I hear your jeers, linux users!), so to use Git, I use Git for Windows

However, I use Git For Windows (portable version) so I can keep my dev environment centrally located. This is so I can reuse this environment simply by copying my msysgit directory to a USB drive.


r-a-y / blogs.php
Last active March 15, 2017 20:28
Modify SQL query for BP's Sites Directory
View blogs.php
* Modify BP's site query for non-super-admins.
add_action( 'bp_include', function() {
// If you're doing checks against More Privacy Options, make sure MPO is active.
if ( ! class_exists( 'ds_more_privacy_options' ) ) {
r-a-y / _bp_rbe_imap_object_cache.php
Last active July 28, 2016 22:21
BP Reply By Email - IMAP Object Cache extension. Replaces the default filesystem IMAP locking system in RBE with a persistent object cache.
View _bp_rbe_imap_object_cache.php
Plugin Name: BP Reply By Email - IMAP Object Cache extension
Description: Replaces the default filesystem IMAP locking system in RBE with a persistent object cache.
Author: r-a-y
Author URI:
License: GPLv2 or later
r-a-y / bp-page-title.php
Created June 13, 2016 05:53
Use page title as set in admin area on BP directory pages.
View bp-page-title.php
* Use page title for BP directory pages.
function my_set_bp_page_title() {
// Check to see if current reset post is a BP directory; if not, bail.
if ( false == in_array( $GLOBALS['post']->ID, bp_core_get_directory_page_ids() ) ) {
// Use WP page title for the_title().
r-a-y / xmlrpc.php
Created May 13, 2016 23:19
Block all XMLRPC requests on WordPress
View xmlrpc.php
// Put this in /wp-content/mu-plugins/.
add_action( 'plugins_loaded', function() {
if ( 'POST' === $_SERVER['REQUEST_METHOD'] && false !== strpos( $_SERVER['SCRIPT_NAME'], '/xmlrpc.php' ) ) {
// Reject with 403.
header( 'HTTP/1.1 403 Forbidden' );
}, 0 );
r-a-y / gestures.js
Last active February 20, 2016 22:14
Mouse gestures script for the Conkeror browser -
View gestures.js
// Mouse Gestures for Conkeror by r-a-y.
// Modified from the Mouse Gestures By Sing Chu userscript:
var BTN_RIGHT = 2;
var SENSITIVITY = 15; //Pixels moved until gesture is registered
var startX;
var startY;
var gesture = "";
r-a-y / cbox-distro
Last active August 29, 2015 14:21
CBOX distro bash script
View cbox-distro
# CBOX distro script
# Before using:
# 1. Ensure that 1.0.x branch has pinned all plugins to latest version.
# 2. Checkout a new branch for @todo decide on a branch name.
# 3. Create the following folder - 'includes/zip'
# Next, run this bash script.
r-a-y / warnings.php
Last active April 15, 2016 01:06
Suppress warnings created by certain plugins and themes in WordPress.
View warnings.php
* Suppress errors generated by specified WordPress plugins.
* Put this in /wp-content/mu-plugins/
* @param string $errno The error number.
* @param string $errstr The error message.
* @param string $errfile Path to the file that caused the error.
* @param int $errline Line number of the error.
* @return bool True to suppress error reporting; false to use default error handler.
r-a-y / wp-ms-login.php
Last active May 17, 2016 12:12
WordPress - Redirects login attempts from sub-sites to the main site to login. Supports mapped domains created by WPMU Domain Mapping.
View wp-ms-login.php
* Get login URL.
* If redirect URL is passed, this function attempts to see if the redirect
* is using a mapped domain. If so, we switch out the mapped domain with the
* original subdomain and force logins from the main site.
* @param string $redirect_to The redirect URL