Skip to content

Instantly share code, notes, and snippets.

@jsit
jsit / SassMeister-input-HTML.html
Created December 16, 2013 20:56
Generated by SassMeister.com.
<div class="columns">
<div class="column" style="background-color:#f00">
</div>
<div class="column" style="background-color:#0f0">
</div>
<div class="column" style="background-color:#00f">
</div>
</div>
@jsit
jsit / SassMeister-input.scss
Created September 4, 2014 14:26
Generated by SassMeister.com.
// ----
// Sass (v3.3.14)
// Compass (v1.0.1)
// ----
$logo-colors: (
red: #f00,
green: #0f0,
blue: #00f
);
@jsit
jsit / get-aq.txt
Created March 14, 2015 19:07
Play Aquarius Records' records of the week samples in VLC
curl http://aquariusrecords.org/ | grep m3u | sed s/^.*href=[\"]*/http:\\/\\/aquariusrecords.org/g | sed s/\>.*//g | /Applications/VLC.app/Contents/MacOS/VLC -vvv -
@jsit
jsit / wp-all-import-events-manager.php
Last active January 4, 2026 00:15
Allow WP All Import to create events with Events Manager
// Create a proper EM_Event object in the database when an event-type post is
// imported with WP All import
add_action('pmxi_saved_post', 'post_saved', 10, 1);
function post_saved($post_id) {
if (class_exists(EM_Event)) {
$event_post = get_post($post_id);
// Only create a new event entry if the imported post is of type event and
// there is not an existing event for this post
$existing_event = em_get_event($event_post->ID, 'post_id');
@jsit
jsit / soundcloud.php
Last active January 4, 2026 00:14
PHP preg_replace strings for AMP HTML extensions
$body = preg_replace( '/<iframe\b[^>]*soundcloud.com\/tracks\/(\d*).*"[^>]*>(.*?)>/', '<amp-soundcloud height=300 layout="fixed-height" data-trackid="$1" data-visual="true"></amp-soundcloud>', $body );
@jsit
jsit / functions.php
Last active January 4, 2026 00:14
Customize WordPress comment form output
<?php
/**
* Rewrite the HTML for the author, email, and url comment fields
*/
function custom_comment_fields( $fields ) {
// https://codex.wordpress.org/Function_Reference/comment_form
$commenter = wp_get_current_commenter();
@jsit
jsit / sieve.sieve
Last active January 4, 2026 00:14
Notifications / mailing lists / bulk email sieve code (for e.g. Fastmail et al.)
if
# Tests for "Mailing Lists"
anyof(
header :is "X-ME-VSCategory" "community:mailing-list",
header :contains "X-Mailer" "Sympa",
exists [
"List-Id",
"List-Help",
"List-Subscribe",
"List-Unsubscribe",
@jsit
jsit / functions.php
Last active January 4, 2026 00:13
Allow WordPress editors to post unfiltered HTML
function allow_editors_to_post_html() {
$role_object = get_role( 'editor' );
$role_object->add_cap( 'unfiltered_html' );
}
add_filter( 'admin_init', 'allow_editors_to_post_html' );
@jsit
jsit / functions.php
Created April 17, 2017 16:17
Allow CodePen attributes in <p> tags
<?php
function add_allowed_tags($tags, $context) {
if ($context === 'post') {
$tags['p'] = array(
'data-height' => true,
'data-theme-id' => true,
'data-slug-hash' => true,
'data-default-tab' => true,
@jsit
jsit / .stylelintrc
Created August 7, 2017 15:19
.stylelintrc / stylelint-order rules for SMACSS property sort order
"order/properties-order": [
{ "properties": [ "content", "quotes" ] },
{ "properties": [ "display", "visibility" ] },
{ "properties": [ "position", "z-index", "top", "right", "bottom", "left" ] },
{ "properties": [ "box-sizing" ] },
{ "properties": [ "flex", "flex-basis", "flex-direction", "flex-flow", "flex-grow", "flex-shrink", "flex-wrap", "align-content", "align-items", "align-self", "justify-content", "order" ] },
{ "properties": [ "width", "min-width", "max-width", "height", "min-height", "max-height" ] },
{ "properties": [ "margin", "margin-top", "margin-right", "margin-bottom", "margin-left" ] },
{ "properties": [ "padding", "padding-top", "padding-right", "padding-bottom", "padding-left" ] },