Skip to content

Instantly share code, notes, and snippets.

View bdougherty's full-sized avatar
🚀
(╯°□°)╯︵ ┻━┻

Brad Dougherty bdougherty

🚀
(╯°□°)╯︵ ┻━┻
View GitHub Profile
import { writable, get } from 'svelte/store';
function makeBroadcastChannelSharedStore(name) {
let channel;
let receivedInitialValue = false;
function sendMessage(action, value = null) {
if (channel) {
channel.postMessage({ action, value });
}
@bdougherty
bdougherty / README.md
Last active April 1, 2022 05:54
Play the Benny Hill theme song while installing npm modules

Add the function somewhere to your dotfiles. Works better if you npm install -g benny-hill first.

# inspiration: https://gist.github.com/jessfraz/7c319b046daa101a4aaef937a20ff41f
Disable-UAC
Enable-MicrosoftUpdate
Install-WindowsUpdate -acceptEula
choco feature enable -n allowGlobalConfirmation
cinst Microsoft-Windows-Subsystem-Linux -source windowsfeatures
# cinst 1password
cinst Firefox
@bdougherty
bdougherty / cloudSettings
Last active April 5, 2019 01:12
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-04-05T01:11:56.935Z","extensionVersion":"v3.2.8"}
@bdougherty
bdougherty / ascii.md
Last active January 4, 2018 08:10
ASCII Mode in the Vimeo Player

ASCII Mode in the Vimeo Player

When ASCII mode is activated, the resolution of the rendering is calculated based on the size of the player. The color resolution is half that of the monochrome. The frame rate is matched to the video, but it's capped at 30fps.

Rendering a frame

  1. The <video> is rendered into an invisible backing canvas at the render resolution (one pixel for each character).
  2. The image data is retrieved from the backing canvas.
  3. It iterates over each pixel and
    1. Determines the character to use for each pixel based on the brightness of the pixel.
Verifying that "bdougherty.id" is my Blockstack ID. https://onename.com/bdougherty
@bdougherty
bdougherty / atom-invisibles-override.less
Last active January 25, 2016 08:49 — forked from justo/atom-invisibles-override.less
Style to make Atom’s tab character a wide line like Sublime Text and to only show invisibles on document highlight and on the current line.
@import "syntax-variables";
atom-text-editor::shadow {
// Make invisible characters the same color as the background, and
// explicitly set the box-shadow color for indent guides (otherwise they
// will be invisible too).
.invisible-character {
color: @syntax-background-color;
&.indent-guide {
@bdougherty
bdougherty / Rules.1blockpkg
Created November 6, 2015 23:32
My custom 1Blocker packages
[{
"id": "0aefa581-b042-4f36-b39c-74daa33b682a",
"name": "Block Annoying Article Stuff",
"rules": [{
"id": "634b4fd6-e2c9-4ce4-bcf9-0d52b4c74baa",
"name": "The Atlantic",
"content": {
"trigger": {
"url-filter": "^[^:]+://+([^:/]+\\.)?theatlantic\\.com[:/]",
"url-filter-is-case-sensitive": true,
@bdougherty
bdougherty / server.py
Created July 21, 2015 19:47 — forked from ccampbell/server.py
Simple static webserver using tornado
#!/usr/bin/env python
import os
import tornado.web
from tornado.ioloop import IOLoop
from tornado.options import define, options
# config options
define('port', default=8080, type=int, help='port to run web server on')
define('debug', default=False, help='start app in debug mode')
options.parse_command_line(final=True)