Skip to content

Instantly share code, notes, and snippets.

@jugglinmike
jugglinmike / README.md
Created February 1, 2019 19:44 — forked from twolfson/README.md
How Python modules are resolved

Python modules have 2 syntaxes for importing.

import x
from x import y

import x

Absolute imports are used for importing top-level modules and only top level modules. These are ones that are globally installed, either inside of Python core or via a package manager (e.g. pip).

@jugglinmike
jugglinmike / user-data.sh
Created January 15, 2019 21:18
Experimenting with mounting EBS volumes in Amazon EC2
#!/bin/bash
# Mount a volume to the system's `/var` directory. This limits the impact of
# unbounded disk usage for log and database files typically stored there.
set -x
# Redirect the output of all commands in this script to a file in `/root`
exec 1<&-
exec 2<&-
@jugglinmike
jugglinmike / issue-report.md
Created January 14, 2019 17:58
WP-Markdown: Newlines not recognized when preserving significant white space
@jugglinmike
jugglinmike / report.md
Created September 28, 2018 19:52
web-platform-tests: uncaught exceptions around `promise_tests`

TaskCluster was configured to log information about tests which use promise_test and produce uncaught exceptions in Chrome or Firefox. The commit that implemented that logging is:

https://github.com/bocoup/wpt/commit/38972d9d995a652dbe4cbe13320bc7a9b6d4c617

The raw data was downloaded with the following command:

./wpt tc-download --artifact-name suspicious.txt --repo-name bocoup/wpt --ref promise-uncaught --out-dir tc-logs/promise-uncaught
@jugglinmike
jugglinmike / dl-summary.sh
Created February 13, 2018 18:06
Summarize WPT Dashboard report data
#!/bin/bash
set -e
here=$(dirname $(readlink -f $0))
function count {
cat <<HERE | python
import json
/**
* Copyright (c) 2017 and later, Isiah Meadows. Licensed under the ISC License.
*/
// Execute the Test262 test suite with a parser. This checks for parser
// conformance correctly, and requires little configuration on your part.
//
// Options supported, `opts.test262Dir`, `opts.test`, and `opts.parse` are
// required:
// - `opts.test262Dir` - The directory to a clone of the Test262 suite
@jugglinmike
jugglinmike / vm.js
Created July 26, 2017 19:20
TypeError from VM context
//vm.createContext({console});
vm.runInThisContext(`
Object.defineProperty(Object.prototype, "length", {
get: function () {
return 1;
},
configurable: true
});
`);
@jugglinmike
jugglinmike / keybase.md
Created July 16, 2017 17:19
keybase.md

Keybase proof

I hereby claim:

  • I am jugglinmike on github.
  • I am jugglinmike (https://keybase.io/jugglinmike) on keybase.
  • I have a public key whose fingerprint is A939 8FBA 551D DAC1 3D74 F3E7 AEB2 9492 DD11 92B1

To claim this, I am signing this object:

1495636449740 webdriver::httpapi DEBUG Creating routes
1495636449743 geckodriver INFO Listening on 127.0.0.1:60569
1495636450742 webdriver::server DEBUG → POST /session {"capabilities": {"alwaysMatch": {"acceptInsecureCerts": true, "browserName": "firefox"}, "firstMatch": []}, "desiredCapabilities": {"acceptInsecureCerts": true, "browserName": "firefox"}}
1495636450742 geckodriver::capabilities DEBUG Trying to read firefox version from ini files
1495636450742 geckodriver::capabilities DEBUG Found version 53.0.2
1495636450800 geckodriver::marionette INFO Starting browser /usr/lib/firefox/firefox.sh with args ["-marionette"]
1495636450803 geckodriver::marionette TRACE connection attempt 0/600
1495636450903 geckodriver::marionette TRACE connection attempt 1/600
1495636451003 geckodriver::marionette TRACE connection attempt 2/600
1495636451104 geckodriver::marionette TRACE connection attempt 3/600
@jugglinmike
jugglinmike / unregister.md
Last active May 17, 2017 19:07
Service Worker investigation

Consider the following code:

// Precondition: `registration`is a valid ServiceWorkerRegistration object with
// a valid "active" worker with no pending events
registration.unregister()
  .then(function() {
      registration.active.postMessage('');
    });