Skip to content

Instantly share code, notes, and snippets.

View ddbeck's full-sized avatar

Daniel D. Beck ddbeck

View GitHub Profile
@ddbeck
ddbeck / brief_example.py
Last active November 8, 2016 12:03
example WebFaction install script
-----BEGIN WEBFACTION INSTALL SCRIPT-----
#!/usr/bin/env python2.7
"""This is a docstring."""
import sys
import xmlrpclib
server = xmlrpclib.ServerProxy('https://api.webfaction.com/')
@ddbeck
ddbeck / bannon_phone_call_script.md
Last active November 16, 2016 08:30
scripts for calling your elected representatives

Hi my name is [your name] and I'm calling from [your city]. I'd like to express my opinion to [Senator/Representative] [the senator or representative's last name] on an important issue. Have I reached the right office for that?

[Usually the answer is yes, though rarely you'll be put on hold or transferred to someone else.]

Thanks!

As you may know, the president-elect has named Stephen Bannon as chief strategist. Bannon is well-known white nationalist and anti-semite and he has no business working in the White House.

I'm calling to ask that the [senator/representative] speak publicly against Bannon's appointment and against the hatred he represents.

@ddbeck
ddbeck / 2018-03-17-output.text
Created March 17, 2018 10:44
BCD deprecated experiments
api.AnimationEvent.initAnimationEvent
api.FetchEvent.client
api.HTMLShadowElement
api.HTMLShadowElement.getDistributedNodes
api.Headers.getAll
api.PositionSensorVRDevice
api.PositionSensorVRDevice.getImmediateState
api.PositionSensorVRDevice.getState
api.PositionSensorVRDevice.resetSensor
api.PushRegistrationManager
#!/usr/bin/env fish
argparse --name=check-urls 'm/since-master' 'v/verbose' -- $argv
or exit
if set -q _flag_since_master
# lines added since master
git diff -U0 master HEAD | grep '^[+]' | read -z diffed
else
# lines added in the current index
const fs = require('fs');
const request = require('request');
const properties = 'css/properties.json';
const urlTemplate = 'https://developer.mozilla.org/docs/Web/CSS/{{replaceme}}';
const urlRegex = new RegExp('{{replaceme}}');
function main() {
const obj = parseJSONFile(properties);
let lookups = {};
@ddbeck
ddbeck / mockup.html
Created August 26, 2018 16:03
Low fidelty mockups for mdn/data CSS summaries
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<style>
body {
font-family: "Open Sans", Arial;
}
div {
padding: 1em;
  • Do the hardest thing first
  • Do the easiest thing first
  • Choose three things to do and a reward for doing them
  • Pomodoro Technique (short): 25 minutes working / 5 minute break
  • Pomodoro Technique (medium): 25 minutes working / 5 minute break / repeat x 2
  • Pomodoro Technique (long): 25 minutes working / 5 minute break / repeat x 4 / 25 minute break
  • Do the next physically possible thing on your list
  • Set timers for the Fibonacci sequence: 1, 1, 2, 3, 5, 8, 13, …
  • Set timers for an exponential sequence: 1, 2, 4, 8, 16, 32, …
  • Set timers for tens of minutes: 10, 20, 30, 40, 50, 60, …
@ddbeck
ddbeck / 001-example.md.raw
Last active June 11, 2019 11:14
Multiple examples in Markdown
---
type: static
---
<!--
This is the raw Markdown as you would write it for an example. Note the flags in the info string of each code block.
-->
Suppose you want to list the winners of a competition:
const visit = require('unist-util-visit')
function transformer(tree, file) {
visit(tree, 'element', (node, index, parent) => {
if (node.tagName === 'div' && node.properties.className && node.properties.className.includes('bc-data')) {
parent.children.splice(index, 1);
}
});
}
@ddbeck
ddbeck / all_safaris.txt
Created July 9, 2019 13:03
Features potentially affected by WebKit misnumbering
api.DOMMatrix
api.DOMMatrix.DOMMatrix
api.DOMMatrix.worker_support
api.DocumentOrShadowRoot.elementsFromPoint
api.PaymentRequest
api.PaymentRequest.PaymentRequest
api.PaymentRequest.abort
api.PaymentRequest.canMakePayment
api.PaymentRequest.id
api.PaymentRequest.onshippingaddresschange