Skip to content

Instantly share code, notes, and snippets.

👮
this is the police

Mike Taylor miketaylr

👮
this is the police
Block or report user

Report or block miketaylr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@miketaylr
miketaylr / defaultbrowser.py
Last active Sep 9, 2019
Set default browser on OSX with Python
View defaultbrowser.py
#/usr/bin/env python
from LaunchServices import LSSetDefaultHandlerForURLScheme
from LaunchServices import LSSetDefaultRoleHandlerForContentType
# 0x00000002 = kLSRolesViewer
# see https://developer.apple.com/library/mac/#documentation/Carbon/Reference/LaunchServicesReference/Reference/reference.html#//apple_ref/c/tdef/LSRolesMask
LSSetDefaultRoleHandlerForContentType("public.html", 0x00000002, "com.operasoftware.operanext")
LSSetDefaultRoleHandlerForContentType("public.xhtml", 0x00000002, "com.operasoftware.operanext")
LSSetDefaultHandlerForURLScheme("http", "com.operasoftware.operanext")
LSSetDefaultHandlerForURLScheme("https", "com.operasoftware.operanext")
View HTML5 input attribute core tests
attrTests: {
testAccept: function(_el) {
return !!(_el.accept === '') && !!(_el.accept !== 'undefined');
},
testAutocomplete: function(_el){
return !!(_el.autocomplete === '') && !!(_el.autocomplete !== 'undefined');
},
testAutofocus: function(_el){
View Vim Kata Number One
# from http://blog.wekeroad.com/2010/05/24/vim-kata-one
I will write a line and hit escape and o to insert a new line and hit escape
I will write a line and hit escape and o to insert a new line and hit escape
I will write a line and hit escape and shift-O to insert a new line above and hit escape
I will write a line and hit escape and shift-O to insert a new line above and hit escape
I will navigate from beginning of line to end of line using 0 and $
I will go to the top of the document by hitting gg
View starbucks-login.js
(function() {
var a = new Error("HALT"),
b = {},
c = {},
d = new Error("stack was non-empty at program completion");
var e = Function.prototype.bind,
f = Function.prototype.call,
g = f.bind(e, f),
h = g(Function.prototype.apply),
i = g(Array.prototype.push),
View Rails checkbox validation with jQuery validate plugin
//The jQuery validate plugin validates on the name attribute,
//which is problematic in Rails because every checkbox
//gets a hidden input with the same name.
//Here's how to validate the checkbox, not the hidden input:
var validate = function(){
$(':input:hidden').attr('name', 'new_name');
$('form').validate({
rules: {"checkbox": "required"},
messages: {"checkbox": "CHECK ME"},
View week-1.md
Bug Cause Outcome
bz-1486494 no idea - debugging is messy, unable to find the right event handler to debug further… :( Pinged tom.
bz-1490459 fullscreen API seems to focus the on macOS, but stays at the on Windows opened bz-1502093
https://webcompat.com/issues/20347 moved to bugzilla 1502233 Google chrome ignore the padding on select elements. It seems to be a regression for the twitter case.
https://webcompat.com/issues/20344 duplicate of bugzilla 1489914 The current UA override is bogus and we get a desktop site instead of a mobile site.
https://webcompat.com/issues/20338 not sure what to do here Flash related issue.
https://webcompat.com/issues/20312 worksforme Focus + blocking cookies break the CSS but that's expected.
https://webcompat.com/issues/20306 needscontact server side sniffing. It doesn't send the mobile version.
https://webcompat.com/issues/20298 duplicate of https://bugzilla.mozilla.org/show_bug.cgi?id=1498257 or https://w
View gist:a22197e331c4ea6a30c73f066b817fda
.fancyselect {
background: url(_gfx/arrow04.gif) right 4px no-repeat #fff;
color: #0098cd;
padding-right: 12px;
-webkit-appearance: none;
-moz-appearance: menulist-textfield;
-ms-appearance: none;
border: 0
}
View gist:e618f4db4ecd83b775131d73b3bf1d76
https://s3-us-west-2.amazonaws.com/support-portal-assets/static/js/main.js
.quick-actions-dropdown{-webkit-appearance:menulist-button;-moz-appearance:menulist-textfield;appearance:menulist-button}
(repeated in 3 different places)
You can’t perform that action at this time.