Skip to content

Instantly share code, notes, and snippets.

View miketaylr's full-sized avatar
🌭

Mike Taylor miketaylr

🌭
View GitHub Profile
@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
(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 / 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
}
@miketaylr
miketaylr / mqm.Util.js
Created January 30, 2014 20:00
mqm.Util
(function() {
Util = {
isDialogShowing: false,
isInterstitialShowing: false,
navigate: function(b, a) {
a = a || {};
if (a.newTab) {
window.open(b);
} else {
document.location.href = b;
@miketaylr
miketaylr / app-min.js
Created January 31, 2014 19:57
app.nytimes.com
var requirejs, require, define;
!function(e) {
function t(e, t) {
return v.call(e, t);
}
function n(e, t) {
var n, r, i, o, s, a, u, l, c, d, p = t && t.split("/"), h = m.map, f = h && h["*"] || {};
if (e && "." === e.charAt(0)) if (t) {
for (p = p.slice(0, p.length - 1), e = p.concat(e.split("/")), l = 0; l < e.length; l += 1) if (d = e[l],
function getParameterByName(b) {
b = b.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var a = "[\\?&]" + b + "=([^&#]*)";
var d = new RegExp(a);
var c = d.exec(window.location.href);
if (c == null) {
return "";
} else {
return decodeURIComponent(c[1].replace(/\+/g, " "));
}
if (!HTMLVideoElement.prototype.canPlayType) {
HTMLVideoElement.prototype.canPlayType = function(type) {
return [
"It is certain",
"It is decidedly so",
"Without a doubt",
"Yes definitely",
"You may rely on it",
"As I see it, yes",
"Most likely",
(function() {
function b(a, c, d) {
if ("_root" == c) return d;
if (a !== d) {
var e;
m || (a.matches && (m = a.matches), a.webkitMatchesSelector && (m = a.webkitMatchesSelector),
a.mozMatchesSelector && (m = a.mozMatchesSelector), a.msMatchesSelector && (m = a.msMatchesSelector),
a.oMatchesSelector && (m = a.oMatchesSelector), m || (m = k.matchesSelector));
e = m;
if (e.call(a, c)) return a;
@miketaylr
miketaylr / checker.py
Last active August 29, 2015 13:56
Bugzilla Tech Evangelism URL status checker
#!/usr/bin/env python
import json
import requests
# This search corresponds to: Tech Evangelism bugs that are UNCONFIRMED, NEW,
# or REOPENED. When we loop through the response, we skip bugs with an empty
# url field.
SEARCH_URL = ("https://api-dev.bugzilla.mozilla.org/latest/bug?"
"bug_status=UNCONFIRMED"
define("core-app/views/login-screen.view", [ "require", "exports", "module", "views/layout.view", "text!core-app/tmpl/login-screen.html", "views/alert.view", "views/modal.view", "utils/device" ], function(e, n, r) {
var i, o, s, a, u, l, c;
return s = e("views/layout.view"), u = e("text!core-app/tmpl/login-screen.html"),
i = e("views/alert.view"), l = e("views/modal.view"), o = e("utils/device"), r.exports = a = function(e) {
function n() {
return c = n.__super__.constructor.apply(this, arguments);
}
return t(n, e), n.prototype.tmpl = u, n.prototype.className = "login-screen", n.prototype.iosErrorMessage = "Sorry, your browser is not supported — to log in or install this app, we recommend\nyou use your native Safari browser. For more details on\nsupported devices and browsers, please visit our FAQ (<a\nhref='http://www.nytimes.com/content/help/mobile/todays-paper/todays-paper.html'>www.nytimes.com/content/help/mobile/todays-paper/to