Skip to content

Instantly share code, notes, and snippets.

@ryanseddon
ryanseddon / dabblet.css
Created January 9, 2012 23:50
Font features
/**
* Font features
*/
p {
font-family: Gabriola, cursive;
font-size: 24pt;
-ms-font-feature-settings: "ss06" 1;
@ryanseddon
ryanseddon / gist:1880661
Created February 22, 2012 02:09
Google Images file drop code
L(w, "drop", function (a) {
a = a || window.event;
a.preventDefault && a.preventDefault();
if (a.dataTransfer.files.length) try {
var b = new FileReader;
b.onload = function (a) {
a = a || window.event;
if (b.readyState == b.DONE && a.target.result) {
for (var c = document.getElementById("dragi"), d = a.target.result, a = [], n = 0, m = 0; m < d.length; m++) {
for (var l = d.charCodeAt(m); 255 < l;) a[n++] = l & 255, l >>= 8;
html, body {
display: table;
height: 100%;
width: 100%;
}
body {
display:table-cell;
vertical-align:middle;
text-align: center;
}
@ryanseddon
ryanseddon / dabblet.css
Created May 8, 2012 00:24 — forked from jackie/dabblet.css
FizzBuzz with CSS
/**
* FizzBuzz with CSS
*/
body {
counter-reset: fizzbuzz;
}
div {
@ryanseddon
ryanseddon / dabblet.css
Created May 8, 2012 00:24
FizzBuzz with CSS
/**
* FizzBuzz with CSS
*/
body {
counter-reset: fizzbuzz;
}
div {
@ryanseddon
ryanseddon / LICENSE.txt
Created January 21, 2013 03:55
postMessage structured clone detection
Copyright (c) 2013 Ryan Seddon
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
@ryanseddon
ryanseddon / index.html
Last active December 18, 2015 09:39
iOS6 will keep the network activity spinner around forever, with no fix, if you do a CORS ajax request at any time with preflight the network activity spinner will stay until the tab is closed.
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Forever iOS network activity spinner</title>
<style>
p {
-webkit-transition: 0.5s ease;
-moz-transition: 0.5s ease;
@ryanseddon
ryanseddon / css.styl
Created October 10, 2013 10:50
How can I do this? Stylus as far as I know doesn't like @supports how can I put the parsed css block into the @css literal. I want it to output like the desired-output.css file.
@css {
@supports (flex-flow: row wrap) {
.foo
display: block
> span
display: inline-block
margin-right: 0.3ch;
foo.bar
> span
@ryanseddon
ryanseddon / curried.es5.js
Created November 6, 2013 02:46
ES5 vs ES6 function currying
function curried(fn) {
var args = Array.prototype.slice.call(arguments, 1);
return function() {
return fn.apply(this, args.concat(Array.prototype.slice.call(arguments, 0)));
}
}
@ryanseddon
ryanseddon / angular-controller-priority.js
Created November 12, 2013 23:20
Angular 1.2.0 breaks when you try and do ng-controller + ng-include on the one element due to priority changes in the directives. Here's a workaround to monkey patch the priority until this ships in a release. See issue https://github.com/angular/angular.js/issues/4431
var app = angular.module('app');
app.config(function($provide) {
$provide.decorator('ngControllerDirective', ['$delegate', function($delegate) {
$delegate[0].priority = 900;
return $delegate;
}]);
});