Skip to content

Instantly share code, notes, and snippets.

View thingsinjars's full-sized avatar

Simon Madine thingsinjars

View GitHub Profile
@thingsinjars
thingsinjars / gist:636030
Created October 20, 2010 08:33
Quick summary of some Touch Events
document.ontouchstart = function(e) {
//This will alert coordinates where you touch the screen
alert(e.touches[0].pageX+', '+e.touches[0].pageY);
//This will alert coordinates if you touch with a second finger at the same time
if(e.touches[1]) {
alert(e.touches[1].pageX+', '+e.touches[1].pageY);
}
}
@thingsinjars
thingsinjars / LICENSE.txt
Created December 8, 2011 21:56 — forked from 140bytes/LICENSE.txt
Attach a handler to generate a draggable file on the fly
DO WHATEVER YOU MIGHT WISH TO PUBLIC LICENSE
Version 1, December 2011
Copyright (C) 2011 SIMON MADINE <http://thingsinjars.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHATEVER YOU MIGHT WISH TO PUBLIC LICENSE
@thingsinjars
thingsinjars / LICENSE.txt
Created December 11, 2011 14:13 — forked from 140bytes/LICENSE.txt
Detect Doctype
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Simon Madine <http://thingsinjars.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@thingsinjars
thingsinjars / LICENSE.txt
Created December 12, 2011 09:39 — forked from 140bytes/LICENSE.txt
Chainable DOM Manipulation
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Simon Madine <http://thingsinjars.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@thingsinjars
thingsinjars / LICENSE.txt
Created December 12, 2011 09:44 — forked from 140bytes/LICENSE.txt
Chainable property setting
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Simon Madine <http://thingsinjars.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@thingsinjars
thingsinjars / contained.css
Created January 31, 2012 13:25
Background size cover and contain examples
div {
width: 75px;
height: 100px;
background: black url('http://www.developer.nokia.com/Community/Piazza/images/Blog-Icon.png') no-repeat 50%;
background-size: contain;
}
@thingsinjars
thingsinjars / expanded.js
Created February 4, 2012 22:32
A True Tale of Love Lost and Found in an Infinite Number of Acts...
//Our little runner, celebration animation and placeholder
// for an empty set of possible maze generation steps
L="♥",
// q = current font size,
// z = width and generic constant,
// h = animation loop counter
q=z=h=21,
// All the colours we need,
// the hsla is pretty but tricky to shorten
@thingsinjars
thingsinjars / dabblet.css
Created February 5, 2012 16:00
Typing animation with pure CSS
/**
* Typing animation with pure CSS
* Revised. Browser support (as of Feb 2012): Firefox, IE10
*/
@keyframes typing { from { width: 0; } }
@keyframes blink-caret { 50% { border-color: transparent; } }
h1 {
font: bold 200% Consolas, Monaco, monospace;
@thingsinjars
thingsinjars / step-1.html
Created June 4, 2012 19:02
Web Audio API Example code
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Web Audio API</title>
</head>
<body>
<p class="play">Play</p>
<p class="stop">Stop</p>
@thingsinjars
thingsinjars / dabblet.css
Created October 30, 2012 12:45
Strikethrough
/*
* Strikethrough
*/
del {
text-decoration:none;
position:relative;
}
del::after {