Skip to content

Instantly share code, notes, and snippets.

View miketaylr's full-sized avatar
🌭

Mike Taylor miketaylr

🌭
View GitHub Profile
@miketaylr
miketaylr / defaultbrowser.py
Last active September 6, 2023 22:38
Set default browser on OSX with Python
#/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")
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) {
function getClientOSVersion(){
const os = getClientOS();
var osVersion = "11.6.3";
if(os.indexOf("Win") != -1)
{
osVersion = getWindowsOSVersion(osVersion);
if (osVersion.match(/11\.0/)) {
osInfo = "Windows 11";
@miketaylr
miketaylr / gist:4b07867c9ab563b4aa380d1627ae5d23
Created January 20, 2021 17:12
accept-ch values in http archive latest (desktop)
select url, accept_ch_value
from (
select distinct NET.REG_DOMAIN(url) as url,
# {"name":"Accept-CH","value":"
REGEXP_EXTRACT(payload, r'(?i)Accept\-CH","value":"(.+?)"') as accept_ch_value
from
`httparchive.latest.requests_desktop`
where
JSON_EXTRACT(payload, '$._headers.response') LIKE '%CH-%'
)
window.NREUM || (NREUM = {});
NREUM.info = {
beacon: "bam-cell.nr-data.net",
errorBeacon: "bam-cell.nr-data.net",
licenseKey: "2d3ab7f8d6",
applicationID: "1341859",
transactionName: "blFbbUQEWEBZUkRcClcbdG91Sn5cVVRzWgtNRlZVWgBEHHFfVFAd",
queueTime: 0,
applicationTime: 146,
agent: "",
/****************************************************************************
* Copyright (C) 2020, Bitmovin, Inc., All Rights Reserved
*
* This source code and its use and distribution, is subject to the terms
* and conditions of the applicable license agreement.
*
* Bitmovin Player Version 8.26.0
*
****************************************************************************/
(function() {
(function() {
var AdModel, AdPodModel, AgeGate, AppController, AppHelper, AppModel, BaseBeaconController, BeaconController, BeaconHelper, BeaconModel, ComscoreBeaconController, Constants, ContentModel, ControlsView, EndCard, EndCardAdModel, EndCardPlaylist, EventBus, FatalError, GeneralEvent, GlobalErrorHandler, HuluBeaconController, Md5, MediaPlayerView, MozartService, NielsenBeaconController, PlayableModel, PlayerController, PlayerModel, PlayerView, PlaylistPlayerModel, PrerollModel, QOSBeaconController, SiteShelfHelper, Ui, VideoEvent, VideoNetworkState, VideoReadyState,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
Md5 = (function() {
//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"},
attrTests: {
testAccept: function(_el) {
return !!(_el.accept === '') && !!(_el.accept !== 'undefined');
},
testAutocomplete: function(_el){
return !!(_el.autocomplete === '') && !!(_el.autocomplete !== 'undefined');
},
testAutofocus: function(_el){