Skip to content

Instantly share code, notes, and snippets.

View miketaylr's full-sized avatar
🌭

Mike Taylor miketaylr

🌭
View GitHub Profile
@miketaylr
miketaylr / barf-function
Created January 30, 2014 18:49
lol @ error-handling
# Beautify contents of clipboard and create .js file
# on Desktop with name of argument
# (requires global uglifyjs installation)
barf () {
echo "Barfing $1.js to Desktop"
pbpaste | uglifyjs -b - > ~/Desktop/$1.js
}
(function() {
var b = navigator.geolocation, i = [], m = {
enableHighAccuracy: true,
maximumAge: 5e3,
timeout: 1e3 * 60 * 2
}, g = null, c = null, n = 0, h = null, a = mqm.Util.isIOS5(), d = function() {
if (b && !c) {
if (a) {
j();
} else {
@miketaylr
miketaylr / pkcs11.txt
Last active August 29, 2015 13:55
Grepping inlined JS from top 64,621 of Alexa 1M list (as of last month).
webdevdata.org-2013-12-09-064743//01/evgenyfireform.com.html.txt:(function(a){window.log=function(){log.history=log.history||[];log.history.push(arguments);if(this.console){console.log(Array.prototype.slice.call(arguments))}};a.fn.snippet=function(e,c){if(typeof e=="object"){c=e}if(typeof e=="string"){e=e.toLowerCase()}var d={style:"random",showNum:true,transparent:false,collapse:false,menu:true,showMsg:"Expand Code",hideMsg:"Collapse Code",clipboard:"",startCollapsed:true,startText:false,box:"",boxColor:"",boxFill:""};var b=["acid","berries-dark","berries-light","bipolar","blacknblue","bright","contrast","darkblue","darkness","desert","dull","easter","emacs","golden","greenlcd","ide-anjuta","ide-codewarrior","ide-devcpp","ide-eclipse","ide-kdev","ide-msvcpp","kwrite","matlab","navy","nedit","neon","night","pablo","peachpuff","print","rand01","the","typical","vampire","vim","vim-dark","whatis","whitengrey","zellner"];if(c){a.extend(d,c)}return this.each(function(){var H=d.style.toLowerCase();if(d.style=="rand
#!usr/bin/env/python
import argparse
import requests
UAS = {
"b2g": "Mozilla/5.0 (Mobile; rv:18.1) Gecko/18.1 Firefox/18.1",
"fxa": "Mozilla/5.0 (Android; Mobile; rv:26.0) Gecko/26.0 Firefox/26.0"
}
window.Modernizr = function (t, u, v) {
function ad(J) {
C.cssText = J
}
function b(J, K) {
return ad(F.join(J + ";") + (K || ""))
}
function f(J, K) {
webdevdata.org-2013-12-09-064743//34/aamaadmiparty.org.html.txt: case CSSRule.CHARSET_RULE:
webdevdata.org-2013-12-09-064743//34/over-blog.es.html.txt:var kCHARSET_RULE_MISSING_SEMICOLON="Missing semicolon at the end of @charset rule";var kCHARSET_RULE_CHARSET_IS_STRING="The charset in the @charset rule should be a string";var kCHARSET_RULE_MISSING_WS="Missing mandatory whitespace after @charset";var kIMPORT_RULE_MISSING_URL="Missing URL in @import rule";var kURL_EOF="Unexpected end of stylesheet";var kURL_WS_INSIDE="Multiple tokens inside a url() notation";var kVARIABLES_RULE_POSITION="@variables rule invalid at this position in the stylesheet";var kIMPORT_RULE_POSITION="@import rule invalid at this position in the stylesheet";var kNAMESPACE_RULE_POSITION="@namespace rule invalid at this position in the stylesheet";var kCHARSET_RULE_CHARSET_SOF="@charset rule invalid at this position in the stylesheet";var kUNKNOWN_AT_RULE="Unknow @-rule";var kENGINES=["webkit","presto","trident","generic"];var
T.load = function () {
var e = r.apply(arguments);
var t = e.pop();
var n = e.length;
var i = 0;
var o = function () {
console.log("callback called");
t.apply(this, arguments)
};
@miketaylr
miketaylr / gist:8321236
Last active January 2, 2016 15:09
Prefixed vs Non-Prefixed CSS property value pairs

What is the list of CSS properties that have variations between prefixed and non-prefixed values? That is, to get from the non-standard to the standard variant you can't just remove the -foo- prefix in prop: -foo-value.

Non-standard here can mean proprietary props that evolved into specced ones, or just early implementations of a spec.

Example,

Flexbox:

Nonstandard:

@miketaylr
miketaylr / gist:8058473
Created December 20, 2013 17:38
getPropertyCSSValue
webdevdata.org-2013-12-09-064743//1a/forum-ptc-investigation.com.html.txt: while (document.defaultView.getComputedStyle(oForeEl, null).getPropertyCSSValue('color') == null && 'parentNode' in oForeEl && 'tagName' in oForeEl.parentNode)
webdevdata.org-2013-12-09-064743//1a/forum-ptc-investigation.com.html.txt: while (document.defaultView.getComputedStyle(oBackEl, null).getPropertyCSSValue('background-color') == null && 'parentNode' in oBackEl && 'tagName' in oBackEl.parentNode)
webdevdata.org-2013-12-09-064743//1a/stream.cz.html.txt:a(d)};d.prototype.getPropertyPriority=function(){throw Error("NotSupportedError: DOM Exception 9");};d.prototype.getPropertyValue=function(a){return this[b(a)]||""};d.prototype.item=function(){throw Error("NoModificationAllowedError: DOM Exception 7");};d.prototype.removeProperty=function(){throw Error("NoModificationAllowedError: DOM Exception 7");};d.prototype.setProperty=function(){throw Error("NoModificationAllowedError: DOM Exception 7");};d.prototype.getPropertyCSSValue=func
@miketaylr
miketaylr / mobile_924b62ff.js
Created December 18, 2013 04:47
Pinterest Mobile JS
/* Windows Phone 7
-----------------------------------------------------------------------------------*/
var MinimumIE = 9;
var InternetExplorer;
var IEVersion;
if ($.browser.msie) {
InternetExplorer = true;
IEVersion = $.browser.version;
} else {