Skip to content

Instantly share code, notes, and snippets.

Avatar
💜
the beat goes on

englishextra englishextra

💜
the beat goes on
View GitHub Profile
View rAF.js
// 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'];
View shimansky.biz-branding-print.css
/**
* gist.github.com/englishextra/cdd503793392281a8a0c
*/
@media print {
html {
font-size: 100%;
margin: 0;
padding: 0;
}
body {
View Super Form Reset.css
/* ----------------------------------------------------------------------------------------------------
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 Apr 17, 2011
shimansky.biz/search/index.php
View gist:924503
<?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 Apr 21, 2011
shimansky.biz/scripts/update.php
View gist:935614
<?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 Jun 24, 2012
General purpose PHP class to work with strings and files
View swamper.class.php
<?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 Mar 20, 2016 — forked from chriswrightdesign/ie8Events.js
Polyfill for IE8 Javascript Event Listeners
View ie8Events.js
(function() {
if (!Event.prototype.preventDefault) {
Event.prototype.preventDefault=function() {
this.returnValue=false;
};
}
if (!Event.prototype.stopPropagation) {
Event.prototype.stopPropagation=function() {
this.cancelBubble=true;
};
View load JS with requestAnimationFrame.js
/*!
* 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 Apr 19, 2016 — forked from Xeoncross/ajax.js
Simple, cross-browser Javascript POST/GET xhr request object. Supports request data and proper AJAX headers.
View ajax.js
/**
* 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 {