Skip to content

Instantly share code, notes, and snippets.

View livingston's full-sized avatar

Livingston Samuel livingston

View GitHub Profile
@livingston
livingston / git-tools.sh
Created August 21, 2010 17:01
GIT Tools
#!/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

iPhone 3.1.2 Webkit 528.18 Safari 528.16

  • -webkit-border-radius cannot be larger than the set/inherited font-size value
@livingston
livingston / js1k-squares.js
Created August 9, 2010 10:43
Entry for JS1K Contest
/*! 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/
*
*/
@livingston
livingston / gist:494520
Last active September 5, 2015 12:45
Browser Bugs

Internet Explorer

  • Create elements dynamically along with attributes using document.createElement

        document.createElement('<div id="wrapper" class="global">')
    

    This will create a div with the attributes id and class set. So the resulting element's html would look like,

        <div id=wrapper class=global></div>
    
// 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(','))@*/
<!DOCTYPE html>
<!--
__ __ ___ ___ __
| | | | \ \ / / | |
| | | | \ \ / / | |
| |____ | | \ \/ / | |
|_______| |__| \____/ |__|
HAND CODED BY LIVINGSTON SAMUEL
-->
<html lang='en'>
@livingston
livingston / iPad UserAgent String
Created June 21, 2010 10:36
iPad Development Stuff
Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10
@livingston
livingston / tracer.js
Created June 11, 2010 07:08
A JavaScript tracer utility in 2kb
/* tracer.js - A tracer utility in 2kb
*
* @author Angus Croll
* http://javascriptweblog.wordpress.com/2010/06/01/a-tracer-utility-in-2kb/
*/
String.prototype.times = function(count) {
return count < 1 ? '' : new Array(count + 1).join(this);
}
@livingston
livingston / bind.js
Created June 8, 2010 19:05
Cross-browser Compatible Bind
/* Cross-browser Compatible Event Bind Method
*
* @arguments element reference, event name, function/function reference
*
*/
var bind = (function (win) {
if (win.addEventListener) {
return function (elem, evt, fn, phase) {
elem.addEventListener(evt, fn, phase || false);
@livingston
livingston / get_barcode_from_image.js
Created June 8, 2010 13:42 — forked from tbtlr/get_barcode_from_image.js
Barcode Recognition with JavaScript
/*
* Copyright (c) 2010 Tobias Schneider
* This script is freely distributable under the terms of the MIT license.
*/
(function(){
var UPC_SET = {
"3211": '0',
"2221": '1',
"2122": '2',