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
| var promote = function(getPrototypeOf, setPrototypeOf){ | |
| // (C) The Evilness | |
| return function(self, Class){ | |
| var | |
| promote = typeof Class == 'function' ? | |
| Class.prototype : getPrototypeOf(Class), | |
| current = self, | |
| previous, | |
| next | |
| ; |
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
| function findOrFallback(where, what, fallback) { | |
| for(var | |
| vendors = ['', 'webkit', 'moz', 'ms', 'o'], | |
| first = what.charAt(0), | |
| others = first.toUpperCase(), | |
| suffix = what.slice(1), | |
| i = 0, length = vendors.length, | |
| current; | |
| i < length; i++ | |
| ) { |
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
| function UMD(name, dependencies, factory) { | |
| // AMD | |
| if ('function' === typeof define && define.AMD) { | |
| define(name, dependencies, factory); | |
| } | |
| // node.js | |
| else if('object' === typeof exports) { | |
| module.exports = factory.apply( | |
| null, | |
| (dependencies || []).map(require) |
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
| var WeakMap = WeakMap || (function (Object) { | |
| /*! (C) Andrea Giammarchi - Mit Style License */ | |
| var | |
| dP = Object.defineProperty, | |
| hOP = Object.hasOwnProperty, | |
| WeakMapPrototype = WeakMap.prototype, | |
| i = 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
| // example: if(!isFontSupported('Batang')) { ... } | |
| // example: if(!isFontSupported('"Andale Mono"')) { ... } | |
| var isFontSupported = (function(document){ | |
| // WebReflection - WTFPL License | |
| var | |
| defaultFamily = getComputedStyle( | |
| document.documentElement, null | |
| ).getPropertyValue('font-family'), | |
| defaultDataURL = '', | |
| str = ['0123456789', 'abcdefghijklmnopqrstuvwxyz', defaultDataURL], |
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
| /*jslint devel: true, indent: 2 */ | |
| // 15.2.3.2 | |
| if (!Object.setPrototypeOf) { | |
| Object.setPrototypeOf = (function(Object, magic) { | |
| 'use strict'; | |
| var set; | |
| function checkArgs(O, proto) { | |
| if (typeof O !== 'object' || O === null) { | |
| throw new TypeError('can not set prototype on a non-object'); | |
| } |
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
| #!/bin/bash | |
| # Usage ./a10.sh /dev/sdx hwpack bindfolder | |
| hwpack_update_only=0 | |
| BOOT_SIZE=64 | |
| TEMP="${TMPDIR:-/tmp}/.a10.$$" | |
| HWPACKDIR="$TEMP" | |
| ROOTFSDIR="$TEMP/rootfs" |
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
| alert('all your gists are belong to us'); |
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
| // all IE < 11 browsers: | |
| // there is no __proto__ | |
| if (!('__proto__' in {})) { | |
| console.log('you gonna have hard time'); | |
| // we need extra logic to be able to work | |
| // as meant in IE too. IE9 ain't disappearing | |
| // any time soon in both desktop and mobile | |
| // neither will IE10 | |
| } | |
| // all Mobile WebKit browsers: |
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.defineProperty( | |
| Object.prototype, | |
| 'implements', | |
| { | |
| enumerable: false, | |
| configurable: true, | |
| writable: true, | |
| value: function (target) { | |
| return Object.getOwnPropertyNames(target).every(function(p){ | |
| var current = this, |