View seo-framework-filters.php
<?php
// Hide author's name from SEO Framework block
add_filter('sybre_waaijer_<3', '__return_false');
// Move SEO Framework metabox below all custom fields
add_filter('the_seo_framework_metabox_priority', function () {
return 'low';
});
View index.js
"use strict";
const aws = require("aws-sdk");
const s3 = new aws.S3({ apiVersion: "2006-03-01" });
const dynamodb = new aws.DynamoDB();
const isNum = n => !isNaN(parseFloat(n)) && isFinite(n);
exports.handler = (event, context, callback) => {
const jsonFileName = "14th-street-webcam.json";
View executable node module.md

Add one line to a node.js module and it becomes a callable script:

// hello-module.js
module.exports = function() {
return "Hello!";
};

if (!module.parent) module.exports();
View 4k-sizes.json
{
"55": {"w": 48.75, "h": 28.5},
"60": {"w": 53.75, "h": 31},
"65": {"w": 57, "h": 33}
}
View regexp-exec-vs-string-match.md

In JavaScript RegExp.exec() and String.match() should be interchangeable so long as the inputs are the same. Right?

const pat = /(dog).*(bird)/g;
const str = 'dog cat bird';

const foo = str.match(pat);
const bar = pat.exec(str);
View gulpfile.js
var gulp = require('gulp');
var browsersync = require('browser-sync').create();
gulp.task('watch', function() {
browsersync.init({
files: './*.html',
startPath: '/some/multi/level/path',
server: {
baseDir: '-',
routes: {
View github-caclulators.js
var githubPriceForUsers = function (users) {
return Math.max(0, users - 5) * 9 + 25;
};
var githubUsersForCost = function (price) {
var f = Math.ceil(Math.max(0, price - 25)/9);
return [`${f + 5} users`, `$${b(f + 5)}`];
}
View some MySQL config leftover
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf
The following groups are read: mysqld server mysqld-5.5
View Git-branch aware Bash prompt.sh
# https://gist.github.com/joemaller/3165ace4b1f8a50924990ad373236ce8
#
# Append this file to the end of your ~/.profile or ~/.bashrc file
# Your terminal prompt will look something like this:
#
# joe@mac-mini /Users/joe/Sites [master]$
# https://gist.github.com/4503986
#
View lsusb
pi@raspberrypi:~ $ lsusb
Bus 001 Device 012: ID 05ac:0220 Apple, Inc. Aluminum Keyboard (ANSI)
Bus 001 Device 011: ID 05ac:1006 Apple, Inc. Hub in Aluminum Keyboard
Bus 001 Device 007: ID 2109:2811
Bus 001 Device 014: ID 05e1:0408 Syntek Semiconductor Co., Ltd STK1160 Video Capture Device
Bus 001 Device 006: ID 2109:2811
Bus 001 Device 005: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]
Bus 001 Device 004: ID 046d:c526 Logitech, Inc. Nano Receiver
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.