-
Create elements dynamically along with attributes using
document.createElement
document.createElement('<div id="wrapper" class="global">')
This will create a
div
with the attributesid
andclass
set. So the resulting element's html would look like,<div id=wrapper class=global></div>
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
<!DOCTYPE html> | |
<!-- | |
__ __ ___ ___ __ | |
| | | | \ \ / / | | | |
| | | | \ \ / / | | | |
| |____ | | \ \/ / | | | |
|_______| |__| \____/ |__| | |
HAND CODED BY LIVINGSTON SAMUEL | |
--> | |
<html lang='en'> |
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
// original (http://html5shiv.googlecode.com/svn/trunk/html5.js) | |
(function(){if(!/*@cc_on!@*/0)return;var e = "abbr,article,aside,audio,canvas,datalist,details,figure,figcaption,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,summary,time,video".split(','),i=e.length;while(i--){document.createElement(e[i])}})() | |
// kangax version (29 characters less, yay!) | |
/*@cc_on(function(e,i){i=e.length;while(i--)document.createElement(e[i])})("abbr,article,aside,audio,canvas,datalist,details,eventsource,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,time,video".split(','))@*/ |
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
/*! Animated Squares | |
* | |
* @author Livingston Samuel | |
* @license MIT License | |
* @url - http://gist.github.com/515271 | |
* Modified version of Squares - http://github.com/livingston/Squares | |
* Original idea by squaredesign - http://squaredesign.com/lab/crazy-squares/ | |
* | |
*/ |
iPhone 3.1.2 Webkit 528.18 Safari 528.16
- -webkit-border-radius cannot be larger than the set/inherited font-size value
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
#!/usr/bin/sh | |
#Short command to clone a git repository | |
## USAGE: gc git://github.com/livingston/rotator.git | |
## this command will clone the git repo in a folder of the format {GITHUB_USER-NAME}_{REPO-NAME} | |
gc() | |
{ | |
str=$1 |
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
<?xml version="1.0"?> | |
<ArrayOfPreset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> | |
<Preset> | |
<Name>iPad and iPhone 4 - Standard Definition</Name> | |
<Query> -f mp4 -w 640 -l 480 -e x264 -b 2048 -a 1 -E faac -6 stereo -R 48 -B 160 -D 0.0 -x ref=2:bframes=2:subq=6:mixed-refs=0:weightb=0:8x8dct=0:trellis=0 -v 1</Query> | |
<PictureSettings>false</PictureSettings> | |
<Version>0.9.4</Version> | |
</Preset> |
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
//Simple tabs with Book-markable urls | |
var handleTabs = (function (tabHandles) { | |
if (!tabHandles || !(/[\s]*hasTabs[\s]*/.test(tabHandles.className))) { | |
return function () {} | |
} | |
var tabHandleParent = $(tabHandles.parentNode), | |
activeClass = 'active', | |
activateTab = function activateTab(tab) { | |
var currentTab = $(tab ? document.getElementById(tab) : tabHandles.getElementsByTagName('a')[0]); |
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
//String Addons | |
//Fastest method to reverse a string http://jsperf.com/livi-002 | |
String.prototype.reverse = function () { return this.split('').reverse().join('') } |
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
Object.defineProperties(Object, { | |
'extend': { | |
'configurable': true, | |
'enumerable': false, | |
'value': function extend(what, wit) { | |
var extObj, witKeys = Object.keys(wit); | |
extObj = Object.keys(what).length ? Object.clone(what) : {}; | |
witKeys.forEach(function (key) { |