Skip to content

Instantly share code, notes, and snippets.

View 4rn0's full-sized avatar

Arno Hoogma 4rn0

View GitHub Profile
@4rn0
4rn0 / Minify.php
Last active August 29, 2015 14:24
Laravel 5 Minify middleware
<?php namespace App\Http\Middleware;
use Illuminate\Http\Response;
use Closure;
class Minify {
/**
* Handle an incoming request.
*
@4rn0
4rn0 / minified.js
Last active December 26, 2015 23:19
538 bytes of silence! (or 0.636313 seconds)
function a(a,b){return Array(b).join(a)}var d="A",e="V",f="//qQwF+rAAAAAAGkGAAAAAAANIOAAABMQU1FMy45M1",g="UxBTUUzLjkz",h="//qSwOafxQPAAAGkAAAAAAAANIAAAAB",i="MQU1FMy45M1",j="f/6ksD63v+DwAABpAAAAAAAADSAAAAA",k="TEFNRTMuOTN",l="X/+pLA+t7/g8AAAaQAAAAAAAA0gAAAAF",m="//qSwPre/4PAAAGkAAAAAAAANIAAAAB",n="U=",o=a(d,143),p=a(d,372),q=a(e,360),r=a(d,527),s=p+"V"+i+o+"V"+j,t=p+"V"+k+o+"V"+l+p+g+o+"VV"+m,u=s+t,src=["data:audio/mp3;base64,","SUQzBAAAAAABBFRDT1AAAAABAAADVExBTgAAAAEAAANUUFVCAAAAAQAAAw",o,f,q,g,o+"VV",h,u,u,u,u,u,u,s,r,n].join("");
<a href="http://causeyoucantyouwontandyoudontstop.com/" class="kick-it">Kick it!</a>
@4rn0
4rn0 / gist:5301749
Created April 3, 2013 14:35
Modernizr.touch extended
Modernizr.addTest("touch", function () {
var e;
if ("ontouchstart" in window || Modernizr.prefixed("MaxTouchPoints", navigator) > 1 || window.DocumentTouch && document instanceof DocumentTouch) {
e = true
} else {
var t = ["@media (", Modernizr._prefixes.join("touch-enabled),("), "heartz", ")", "{#modernizr{top:9px;position:absolute}}"].join("");
Modernizr.testStyles(t, function (t) {
e = t.offsetTop === 9
})
}
@4rn0
4rn0 / gist:4174742
Created November 30, 2012 09:30
Modernizr HTTP Live Streaming test
Modernizr.addTest('hls', function() {
var a = navigator.userAgent,
b = document.createElement('video');
if (a.match(/iPhone|iPod|iPad/)) {
return true
}
try {
@4rn0
4rn0 / gist:3146246
Created July 19, 2012 19:34
Trigger fullscreen HTML5 video on iPad
<!DOCTYPE html>
<html>
<head>
<title>Trigger fullscreen HTML5 video on iPad</title>
<style>
#video { height: 1px; opacity: 0; position: absolute; width: 1px; }
#play { width: 100px; }
</style>
</head>
<body>