Skip to content

Instantly share code, notes, and snippets.

View englishextra's full-sized avatar
💜
the beat goes on

englishextra englishextra

💜
the beat goes on
View GitHub Profile
// 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'];
/**
* gist.github.com/englishextra/cdd503793392281a8a0c
*/
@media print {
html {
font-size: 100%;
margin: 0;
padding: 0;
}
body {
/* ----------------------------------------------------------------------------------------------------
Super Form Reset
A couple of things to watch out for:
- IE8: If a text input doesn't have padding on all sides or none the text won't be centered.
- The default border sizes on text inputs in all UAs seem to be slightly different. You're better off using custom borders.
- You NEED to set the font-size and family on all form elements
- Search inputs need to have their appearance reset and the box-sizing set to content-box to match other UAs
@englishextra
englishextra / gist:924503
Created April 17, 2011 21:41
shimansky.biz/search/index.php
<?php
/**
* Documents the class following or the file?
* @package Shimansky.biz-web-site-source-code
*/
$relpa = preg_replace("/[\/]+/", "/", $_SERVER['DOCUMENT_ROOT'] . '/');
$a = array(
'inc/init2.inc'
@englishextra
englishextra / gist:935614
Created April 21, 2011 22:23
shimansky.biz/scripts/update.php
<?php
/**
* Documents the class following or the file?
* @package Shimansky.biz-web-site-source-code
*/
$relpa = preg_replace("/[\/]+/", "/", $_SERVER['DOCUMENT_ROOT'] . '/');
$a = array(
'inc/init2.inc'
@englishextra
englishextra / swamper.class.php
Created June 24, 2012 06:14
General purpose PHP class to work with strings and files
<?php
/**
* shimansky.biz
*
* Static web site core scripts
* @package shimansky.biz
* @author Serguei Shimansky <serguei@shimansky.biz>
* @copyright Serguei Shimansky 10:07 24.06.2012
* @access public
* @version 0.2
@englishextra
englishextra / ie8Events.js
Created March 20, 2016 09:24 — forked from chriswrightdesign/ie8Events.js
Polyfill for IE8 Javascript Event Listeners
(function() {
if (!Event.prototype.preventDefault) {
Event.prototype.preventDefault=function() {
this.returnValue=false;
};
}
if (!Event.prototype.stopPropagation) {
Event.prototype.stopPropagation=function() {
this.cancelBubble=true;
};
/*!
* load JS with requestAnimationFrame
* stackoverflow.com/questions/28394097/async-loading-css-stylesheet-using-requestanimationframe
*/
function loadJSwithRaf(s, c) {
function l() {
var a = document.getElementsByTagName("script")[0],
t = document.createElement("script");
t.src = s;
t.async = !0;
@englishextra
englishextra / ajax.js
Created April 19, 2016 13:36 — forked from xeoncross/ajax.js
Simple, cross-browser Javascript POST/GET xhr request object. Supports request data and proper AJAX headers.
/**
* IE 5.5+, Firefox, Opera, Chrome, Safari XHR object
*
* @param string url
* @param object callback
* @param mixed data
* @param null x
*/
function ajax(url, callback, data, x) {
try {