Skip to content

Instantly share code, notes, and snippets.

View lmorchard's full-sized avatar
😅
drinking from multiple firehoses

Les Orchard lmorchard

😅
drinking from multiple firehoses
View GitHub Profile
@lmorchard
lmorchard / contentScript.js
Created March 7, 2018 19:38
Messaging bridge in a webextension content script
import { CHANNEL_NAME } from "../lib/constants";
// Relay backend port messages to content
let port;
function connect() {
port = browser.runtime.connect({ name: CHANNEL_NAME });
port.onDisconnect.addListener(() => {
port = null;
reconnect();
const fs = require('fs');
const path = require('path');
const util = require('util');
const globby = require('globby');
const readFile = util.promisify(fs.readFile);
// const YAML = require('yamljs');
// const ContentTransformerPlugin = require('./frontend/lib/content-transformer-plugin');
//
// new ContentTransformerPlugin({
@lmorchard
lmorchard / googly_eyes.ino
Last active October 15, 2015 05:15
Random 7219 LED matrix Arduino eyes
#include "LedControl.h"
LedControl lc = LedControl(12, 11, 10, 2); // Pins: DIN,CLK,CS, # of Display connected
const bool DEBUG = true;
const int NUM_EYES = 2;
const int NUM_COLS = 8;
const int NUM_ROWS = 8;
const int MOVE_EYE_DELAY = 100;
@lmorchard
lmorchard / keybase.md
Created April 2, 2014 17:13
keybase.md

Keybase proof

I hereby claim:

  • I am lmorchard on github.
  • I am lmorchard (https://keybase.io/lmorchard) on keybase.
  • I have a public key whose fingerprint is 1F75 8522 08D5 284D 9680 5EFF 3D7E E8C3 BE5E C6B3

To claim this, I am signing this object:

@lmorchard
lmorchard / parsec-patrol-diaries-backlog
Last active December 28, 2015 19:09
Parsec Diaries backlog
* Initial explorations with Yeoman, Grunt, Bower
* Coffeescript
* livereload - and mobile devices
* Tweaking grunt setup to use Stylus
* Travis-CI integration
* Discovering the Entity-Component-System design model
@lmorchard
lmorchard / tox-badger-errors
Created August 22, 2013 17:34
tox errors on django-badger
GLOB sdist-make: /Users/lmorchard/devel/mozilla/django-badger/setup.py
py26_dj14 inst-nodeps: /Users/lmorchard/devel/mozilla/django-badger/.tox/dist/django-badger-0.0.1.zip
ERROR: invocation failed, logfile: /Users/lmorchard/devel/mozilla/django-badger/.tox/py26_dj14/log/py26_dj14-3.log
ERROR: actionid=py26_dj14
msg=installpkg
cmdargs=[local('/Users/lmorchard/devel/mozilla/django-badger/.tox/py26_dj14/bin/pip'), 'install', '--pre', '/Users/lmorchard/devel/mozilla/django-badger/.tox/dist/django-badger-0.0.1.zip', '-U', '--no-deps']
env={'PYTHONIOENCODING': 'utf_8', 'LESS': '-XRF', 'VERSIONER_PYTHON_PREFER_32_BIT': 'no', 'LC_CTYPE': 'en_US.UTF-8', 'TMPDIR': '/var/folders/9k/7vwks0gs4nggpjzzz48n_k000000gn/T/', 'LOGNAME': 'lmorchard', 'USER': 'lmorchard', 'PATH': '/Users/lmorchard/devel/mozilla/django-badger/.tox/py26_dj14/bin:/usr/local/heroku/bin:node_modules/.bin:/Users/lmorchard/.local/bin:/usr/local/bin:/Users/lmorchard/Applications:/Applications:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/npm/bin', 'HOME
@lmorchard
lmorchard / scrape-mdn-push-history.py
Created April 8, 2013 16:57
This is the python scraper I use to push MDN chief log data to an MDN wiki page.
#!/usr/bin/env python
import sys
sys.path.append('/home/lorchard/.local/lib/python2.6/')
import json
import requests
from requests.auth import HTTPBasicAuth
from bs4 import BeautifulSoup
cd puppet/cache
tar -zxf prince-7.1-linux.tar.gz
cd ../..
vagrant provision
cd puppet/cache
wget http://people.mozilla.com/~lorchard/nodejs-stable-release.noarch.rpm
cd ../..
vagrant provision
Components.utils.import("resource:///modules/devtools/gcli.jsm");
gcli.addCommand({
name: 'cssdoc',
description: 'Documentation for CSS properties',
returnType: 'html',
params: [
{
name: 'property',
type: 'string',