This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// jQuery to JavaScript - src: http://sharedfil.es/js-48hIfQE4XK.html | |
//--------------------------------------------------// | |
$(document).ready(function() { | |
// code… | |
}); | |
document.addEventListener("DOMContentLoaded", function() { | |
// code… | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var img = new Image(), | |
supported = false; | |
img.src ="data:image/webp;base64,UklGRkYAAABXRUJQVlA4IDoAAABwAgCdASoEAAQAAYcIhYWIhYSIiQIADAzdrBLeABAAAAEAAAEAAPKn5Nn/0v8//Zxn/6H3QAAAAAA="; | |
img.onload = function() { supported = true; } | |
img.onerror = function(e) {} | |
window.onload = function() { | |
if (supported) { | |
document.getElementsByTagName('html')[0].className += ' webp'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Tested in: | |
Chrome - 22 : Works | |
FF - 16 : Works | |
IE - 10 | |
IE - 9 : Works | |
IE - 8 : no alert - check at home | |
IE - 7 : no alert - "" | |
IE - 6 : posts alert twice |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@media only screen and (min-width: 320px) { | |
/* Small screen, non-retina */ | |
} | |
@media | |
only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 320px), | |
only screen and ( min--moz-device-pixel-ratio: 2) and (min-width: 320px), | |
only screen and ( -o-min-device-pixel-ratio: 2/1) and (min-width: 320px), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"bold_folder_labels": true, | |
"color_scheme": "Packages/Color Scheme - Default/github.tmtheme", | |
"font_face": "Courier New", | |
"font_size": 10, | |
"wide_caret": true, | |
"word_wrap": true, | |
"tab_size": 2, | |
"translate_tabs_to_spaces": false | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ReSRC = function() { | |
"use strict"; | |
function h(e, t, n) { | |
var r = new Array; | |
t == null && (t = document); | |
n == null && (n = "*"); | |
var i = t.getElementsByTagName(n), s = i.length, o = new RegExp("(^|\\s)" + e + "(\\s|$)"), u, a; | |
for (u = 0, a = 0; u < s; u++) if (o.test(i[u].className)) { | |
r[a] = i[u]; | |
a++; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<picture alt=""> | |
<!-- If browser supports WebP, use image below: --> | |
<source src="fullsize.webp" type="image/webp"> | |
<!-- Else, use image from which ever source tag currently matches --> | |
<source src="mobile.jpg"> | |
<source src="medium.jpg" media="min-width: 600px"> | |
<source src="fullsize.jpg" media="min-width: 900px"> | |
<img src="mobile.jpg"> | |
</picture> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
webP feature detect by jameswestgate | |
http://queryj.wordpress.com/2012/06/11/detecting-webp-support/ | |
*/ | |
function testWepP() { | |
var webP = new Image(); | |
webP.src = 'data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIAL' + | |
'mk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA'; | |
webP.onload = webP.onerror = function () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<head> | |
<meta name='srcset' var='small' value='320w' /> | |
<meta name='srcset' var='small-2x' value='320w 2x;' /> | |
<meta name='srcset' var='medium' value='600w' /> | |
<meta name='srcset' var='medium-2x' value='600w 2x;' /> | |
<meta name='srcset' var='large' value='1000w' /> | |
</head> | |
<body> | |
<img src="images/small/photo.jpg" srcset="images/{srcset}/photo.jpg" alt="The Breakfast Combo"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<head> | |
<meta name='media' var='small' media='min-width:320px' /> | |
<meta name='media' var='small-2x' media='min-width:320px and min-device-pixel-ratio:2;' /> | |
<meta name='media' var='medium' media='min-width:600px' /> | |
<meta name='media' var='medium-2x' media='min-width:600px and min-device-pixel-ratio:2;' /> | |
<meta name='media' var='large' media='min-width:1000px' /> | |
</head> | |
<body> | |
<picture alt=""> |