Skip to content

Instantly share code, notes, and snippets.

@jtwalters
jtwalters / SassMeister-input-HTML.html
Created November 17, 2015 19:04
Generated by SassMeister.com.
<div class="foo">Foo</div>
<div class="bar">Bar</div>
<html>
<head>
<script src="https://vjs.zencdn.net/5.0/video.min.js"></script>
</head>
<body>
Hello,
<script>
document.write('World!');
</script>
</body>
@jtwalters
jtwalters / commit-msg
Created August 22, 2015 00:16
Throw this in .git/hooks/commit-msg and chmod +x it.
#!/usr/local/bin/node
/* jshint node:true */
// This hook ensures the commit message includes [ci skip] or [ci run]
var fs = require('fs'),
spawn = require('child_process').spawn,
args = process.argv.slice(2),
filePath = args[0],
@jtwalters
jtwalters / sticky-list-heading.js
Last active February 5, 2019 23:28
List with sticky headings/titles, where each sticky element is constrained/bound to its parent. Requires jQuery, Waypoints (http://imakewebthings.com/waypoints/)
/**
* Sticky, single elements bound to their containers.
* Parent: .sticky-single
* Child: .sticky-single__element
*/
$('.sticky-single__element').each(function initializeStickySingle() {
// Create an "enter" sticky-single waypoint handler.
new Waypoint({
element: this,
offset: 0,
accessibility: Accessibility
adminux: Admin/editor UX
analytics: Analytics
api: APIs
build: Build tools
ci: Continous integration
crm: CRM / Eloqua / SalesForce
css: CSS / SASS
db: Databases
dependency: Dependecy management
@jtwalters
jtwalters / tinytune.ino
Created March 6, 2015 20:49
A little Arduino-based project that sounds like a Theremin. Uses a distance sensor for one hand and a pushbutton for the other.
// #define EVENTMANAGER_EVENT_QUEUE_SIZE 20
// #define EVENTMANAGER_LISTENER_LIST_SIZE 10
// #include <EventManager.h>
#include <Event.h>
#include <Timer.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_LEDBackpack.h>
#include <RunningAverage.h>
#include <CapacitivePin.h>
@jtwalters
jtwalters / please.js
Created March 5, 2015 22:01
console.log('PLEASE');
[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]](([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+
@jtwalters
jtwalters / jquery-patterns.js
Last active August 29, 2015 14:15
Some JS/jQuery patterns.
/**
* JS Patterns
*/
/**
* 1. Mixed jQuery
*/
(function($, window, document, undefined) {
foo = false;
(function () {
foo = true;
})();
setTimeout(function () {
foo = false;
}, 0);
@jtwalters
jtwalters / huge-click-regions.js
Last active August 29, 2015 14:15
Make the click regions big.
$(function initLargeClickRegions() {
// Make the entire views row clickable to the first link element within the row.
$('.views-row').each(function () {
var $link = $(this).find('a:first');
if ($link.length) {
$(this).css('cursor', 'pointer');
$(this).on('click.expanded', function (e) {
// Only if a simple primary mouse button click (no ctrl/meta key
// pressed) and not a link (or child of link)