Skip to content

Instantly share code, notes, and snippets.

/**
* For jQuery versions less than 3.4.0, this replaces the jQuery.extend
* function with the one from jQuery 3.4.0, slightly modified (documented
* below) to be compatible with older jQuery versions and browsers.
*
* This provides the Object.prototype pollution vulnerability fix to Drupal
* installations running older jQuery versions, including the versions shipped
* with Drupal core and https://www.drupal.org/project/jquery_update.
*
* @see https://github.com/jquery/jquery/pull/4333
@jtwalters
jtwalters / alter-table-node.sql
Created February 27, 2019 23:59
Use this SQL statement below on your _LOCAL_ environment to make the next created node match a specific NID.
/*
Use the SQL statement below on your _LOCAL_ environment to make the next created node match a specific NID.
*/
ALTER TABLE node AUTO_INCREMENT = 123456
@jtwalters
jtwalters / README.md
Last active April 21, 2017 17:30
Better Filters for GitHub — Provides filters for GitHub Projects.

Better Filters for GitHub was written to help a large Project board more manageable, by toggling the label display, and filtering down to issues tagged with a certain label or assignee.

It looks like this:

Install

@jtwalters
jtwalters / LakeUnion10K.csv
Last active August 15, 2016 16:39
2016 Lake Union 10K Results (as of 8/15) — CSV Download
Rank Name Bib Time Time (Minutes) Pace Pace (Minutes) Hometown Division Div Rank
1 Andrew Ivanov 698 00:33:40 33.667 05:25 5.417 apt 534, WA m30-34 1
2 Jonathan Youell 1522 00:33:59 33.983 05:29 5.483 Boise, ID m25-29 1
3 Jalen Chase 299 00:34:11 34.183 05:30 5.500 New Town, ND m15-19 1
4 Lance Thompson 1387 00:34:18 34.300 05:32 5.533 US m35-39 1
5 Jacob Marsh 890 00:35:17 35.283 05:41 5.683 Seattle, WA m30-34 2
6 Zach Chupik 317 00:37:24 37.400 06:02 6.033 Bothell, WA m15-19 2
7 James Ebberson 425 00:37:27 37.450 06:02 6.033 Seattle, WA m30-34 3
8 Jamie Miller 952 00:37:29 37.483 06:02 6.033 Seattle, WA m35-39 2
9 Eduardo Carrillo 278 00:37:33 37.550 06:03 6.050 Lynnwood, WA m35-39 3
@jtwalters
jtwalters / parse-duration-to-seconds.js
Last active March 21, 2016 18:09
Parse DOM element's h:mm:ss to seconds and replace (in place).
// Parse duration value from table cell, replacing as seconds...
$table.find('td:nth-child(7)').each(function () {
var value = this.innerHTML.trim(),
seconds = moment.duration(value).asSeconds();
this.innerHTML = seconds;
});
@jtwalters
jtwalters / convert-mm-ss-durations.js
Created March 21, 2016 17:44
Normalize m:ss, mm:ss, etc., to h:mm:ss
$table.find('td:nth-child(7)').each(function () {
var value = this.innerHTML.trim(),
parts = value.split(':');
// convert mm:ss to hh:mm:ss
if (parts.length === 2) {
// zero-pad minutes
if (parts[0].length < 2) {
value = '0' + value;
}
this.innerHTML = '00:' + value;
#!/bin/bash
CMD="chmod u+w sites/default"
echo "➤ $CMD"
eval $CMD
/**
* New Tabia/Components JS-pattern.
*/
// Loose augmentation pattern. Creates top-level namespace variable if it
// doesn't already exist.
var Tabia = Tabia || {};
// Create a base for this module's data and functions.
Tabia.myBehavior = {};
@jtwalters
jtwalters / jwalters.yaml
Last active January 1, 2016 23:36 — forked from doublejosh/favorite_work.yaml
Tableau Labels-based Issue Preference Profile
---
name: Joel Walters
email: [email protected]
favSkills:
# Front-end
- skill-front
- tag-IE
- tag-mobile
- skill-ops
intSkills:
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
window.videojs.plugin('autoCaptions', function () {
var player = this,
langMap = {