Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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: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 / index.html
Last active August 29, 2015 14:03
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 / 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 / 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 / index
Created May 22, 2010 15:51 — forked from anonymous/index
EE template: blog/index
{exp:channel:entries channel="blog" limit="10"}
<div class="post">
<h2 class="postTitle"><a href="{url_title_path='blog/detail'}">{title}</a></h2>
<p>Posted {entry_date format='%m/%d'} by {screen_name} </p>
{summary}
@unruthless
unruthless / detail
Created May 22, 2010 15:54 — forked from anonymous/detail
EE template: blog/detail
{!-- Segment_2 isn't blank, so show a blog post's details --}
{if segment_2 != ""}
{exp:channel:entries channel="blog" url_title="{segment_2}"}
{!-- If no results,
then segment_2 isn't a URL title for any existing blog post (typo? broken link?),
so redirect to the landing page --}
{if no_results}
@unruthless
unruthless / index
Created May 22, 2010 14:20
EE template: combined index and detail page
...
{!-- Segment_2 isn't blank, so show a blog post's detail page --}
{if segment_2 != ""}
<h1>Single Post</h1>
{exp:channel:entries channel="blog" url_title="{segment_2}"}
{!-- If segment_2 isn't a URL title for any existing blog post, redirect to the landing page --}