Skip to content

Instantly share code, notes, and snippets.

View richtr's full-sized avatar

Rich Tibbett richtr

View GitHub Profile
@richtr
richtr / style_scoped_shim.js
Created November 8, 2012 15:12
<style scoped> polyfill
/*!
* <style scoped> shim
* http://github.com/richtr
*
* Copyright 2012 Rich Tibbett
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
* Date: 8th November 2012
*/
@richtr
richtr / orientationChange.js
Last active February 26, 2021 09:11
JavaScript shim of iOS's window.orientation + orientationchange events for other (typically mobile) browsers
/*
* OrientationChange Event Shim
* http://github.com/richtr
*
* Copyright (c) 2012, Rich Tibbett
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
@richtr
richtr / Element.js
Created February 3, 2012 14:25
DOM Element Constructor wrapper
/**
* DOM Element constructor helper class.
*
* Usage:
* -------
* var newDiv = Element.create('div');
* var newDiv = Element.create('div', {text: "Hi"});
* var newDiv = Element.create('div', {text: "Hi "}, [
* Element.create('span', {style: 'color: #CC0000', html:"<b>you</b>"}, [
* // Infinitely chainable