Skip to content

Instantly share code, notes, and snippets.

View gonzomir's full-sized avatar

Milen Petrinski gonzomir

View GitHub Profile
/*
A Revised Font Stack
from A Way Back
http://www.awayback.com/revised-font-stack/
*/
/*
@drewm
drewm / slow_image_loader.php
Created December 13, 2010 10:44
Artificially delay the loading of images to simulate a slow connection
<?php
/*
Artificially delay the loading of images to simulate a slow connection
<img src="/slow_image_loader.php?img=realimage.jpg" />
*/
$image = $_GET['img'];
// delay between 1 and 3 seconds
usleep(rand(1000000,3000000));
@Integralist
Integralist / detect.css
Created August 16, 2011 08:21
A better way to detect :before and :after CSS pseudo-element selector support using JavaScript (Modernizr takes similar route)
body {
font: normal small Helvetica, Arial, Verdana, sans-serif;
}
h1 {
border-bottom: 1px solid #C00;
color: #666;
font-weight: bold;
margin-bottom: 10px;
}
@scottjehl
scottjehl / hideaddrbar.js
Created August 31, 2011 11:42
Normalized hide address bar for iOS & Android
/*
* Normalized hide address bar for iOS & Android
* (c) Scott Jehl, scottjehl.com
* MIT License
*/
(function( win ){
var doc = win.document;
// If there's a hash, or addEventListener is undefined, stop here
if( !location.hash && win.addEventListener ){
@paulirish
paulirish / rAF.js
Last active June 11, 2024 14:29
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@scottjehl
scottjehl / getViewportSize.js
Created March 16, 2012 19:25
Reliably get viewport dimensions in JS
/*!
An experiment in getting accurate visible viewport dimensions across devices
(c) 2012 Scott Jehl.
MIT/GPLv2 Licence
*/
function viewportSize(){
var test = document.createElement( "div" );
test.style.cssText = "position: fixed;top: 0;left: 0;bottom: 0;right: 0;";
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->
@tkadlec
tkadlec / trigram.html
Last active September 16, 2021 11:22
Trigram for heaven icon
<!DOCTYPE html>
<html>
<head>
<title>Trigram for heaven icon</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
li {
list-style-type: none;
}
@marcedwards
marcedwards / high-dpi-media.css
Last active November 19, 2023 12:56
A CSS media query that captures almost all high DPI aware devices.
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */
@murtaugh
murtaugh / 1. single-line.html
Last active April 21, 2021 16:23
Blockquote patterns for ALA
<figure class="quote">
<blockquote>It is the unofficial force—the Baker Street irregulars.</blockquote>
</figure>