Skip to content

Instantly share code, notes, and snippets.

@unruthless
unruthless / gist:7aa125be39eb57ab19c7
Created March 13, 2015 18:44
Transition bind/unbind pattern
var transitionend = 'webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend',
$el = $('.foo'),
onTransitionEnd = function(event) {
$el.off(transitionend);
};
$el.on(transitionend, onTransitionEnd);
@unruthless
unruthless / README.md
Last active August 29, 2015 14:03
World Cup "Injuries"

A quick scatterplot to show this data:

http://www.reddit.com/r/sports/comments/297gsu/oh_the_agony/

To improve:

  • Not enough colors to have a unique color per team
  • Some labels are overlapping and obscuring each other.
  • Superlative stats would be useful (most "injury"-prone, biggest delayer of game, most stoic/likely to survive zombie apocalypse)
@unruthless
unruthless / index.html
Last active July 15, 2024 14:39
Simple scrubber UI component
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Scrubber.js</title>
<style type="text/css">
.container {
background: #333;
@unruthless
unruthless / gist:5ae56a935b5edfc7c66e
Created June 17, 2014 00:21
Find and kill a process
# Get process ID
ps aux | grep -i "Program To Kill"
# Kill the process
killall -9 PID
@unruthless
unruthless / globalsniffer.js
Last active August 29, 2015 14:02
sniffs for global variables
/**
* Detect Globals
* @source https://github.com/sindresorhus/log-globals
*/
(function () {
'use strict';
function getIframe() {
var el = document.createElement('iframe');
@unruthless
unruthless / gist:11383824
Last active January 3, 2024 08:57
HTML Email Template guidelines

General guidelines for designing HTML email templates.

Questions and comments welcome anytime – thanks for reading!

KEY TAKEAWAY:

  • Coding for HTML emails is like coding for Internet browsers from 10 years ago. (It’s the email clients’ — Outlook, etc. — fault.)
  • Picture a website from a decade ago: that’s the level of design complexity we can reasonably shoot for.

WIDTH:

@unruthless
unruthless / gist:11383785
Created April 28, 2014 20:58
Prototyping tools
Pop App https://popapp.in/
Marvel App https://marvelapp.com/iphone/
IDEs
Macaw http://macaw.co/
Sketch http://bohemiancoding.com/sketch/
Sketch & D3 http://snips.net/blog/posts/2014/01-10-fast-interactive_prototyping_with_d3_js.html
Hardware
@unruthless
unruthless / preventPinchToZoom.js
Created April 28, 2014 15:53
Prevent pinch-to-zoom on Win8/Chrome tablet
(function () {
'use strict';
function preventPinchToZoom(event) {
if (event.touches.length >= 2) {
event.stopPropagation();
event.preventDefault();
}
}
@unruthless
unruthless / mq-boilerplate.css
Last active July 5, 2016 10:11
Media Query Boilerplate
/**
* Target styles based on screen color support
*/
/* Screen is in monochrome */
@media (monochrome) {
}
/* Screen is in color */
@media (color) {