Skip to content

Instantly share code, notes, and snippets.

@Dammmien
Dammmien / super_array.js
Last active August 29, 2015 14:07
Super Array
var SA = function( a ) {
a.has = function( v ) {
var i = a.length;
for ( i; i--; )
if ( a[ i ] === v )
return true;
return false;
};
@Dammmien
Dammmien / perfect_centering.css
Last active December 21, 2015 00:48
Absolute Horizontal And Vertical Centering
#foo{
height: 150px;
width: 300px;
margin: auto;
position: absolute;
top: 0; left: 0; bottom: 0; right: 0;
}
@Dammmien
Dammmien / Detect Touch Device.js
Created May 23, 2013 09:28
Detect Touch Device
var ua = navigator.userAgent,
isApple = /iPad/i.test(ua) || /iPhone/i.test(ua),
isAndroid = ua.toLowerCase().indexOf("android") > -1;
if(isAndroid || isApple) {
// do something ;
}