Skip to content

Instantly share code, notes, and snippets.

View matthewhudson's full-sized avatar

Matthew Hudson matthewhudson

View GitHub Profile

Shell fuction that downloads the boilerplate.html template.

html5() {
  curl -O https://gist.githubusercontent.com/matthewhudson/aa295b9643f889c48eff9346888ee5f4/raw/cce08c2ed5d87ce761eea87b46c0b72358fa7e28/boilerplate.html
}

Alternatively, you can pull the official h5bp like this:

@matthewhudson
matthewhudson / itsokto.md
Last active January 13, 2021 05:32
It's ok to...

It's ok to...

  • say "I don't know"
  • ask for more clarity
  • stay at home when you feel ill
  • say you don't understand
  • ask what acronyms stand for
  • ask why, and why not
  • forget things
  • introduce yourself
@matthewhudson
matthewhudson / index.js
Last active September 17, 2019 10:06
OMG & @webpipe/server interface idea
const WebPipeServer = require('@webpipe/server');
// Automatically exposes service definition
// Automatically exposes `/health` checkpoint
module.exports = new WebPipeServer()
// .enableDevelopmentMode() // This line enables dev mode
// .enableMonitorMode() // This line enables monitor mode
.configureEnvironment(environment => {
environment.setVariable()
// environment.setPort()
@matthewhudson
matthewhudson / index.html
Created August 14, 2019 17:29
Planets Nav - CPC Fork This
<nav>
<ul>
<li><a href="#0">Home</a></li>
<li><a href="#0">About</a></li>
<li>
<a href="#0">Clients</a>
<ul>
<li><a href="#0">Burger King</a></li>
<li><a href="#0">Southwest Airlines</a></li>
<li><a href="#0">Levi Strauss</a></li>
@matthewhudson
matthewhudson / style.css
Created June 19, 2019 01:15
CSS Custom Properties
/*
Found these unfamiliar `--` prefixes on a page and started researching: https://www.learn-html.org/en/Basic_Elements
You can prefix a double dash to define custom CSS properties: https://drafts.csswg.org/css-variables/
Browser support is solid: https://caniuse.com/#feat=css-variables
*/
:root {
--blue: #000;
--indigo: #6610f2;
--purple: #6f42c1;
--pink: #e83e8c;
@matthewhudson
matthewhudson / atom-macos-context-menu.md
Created May 25, 2019 08:52 — forked from idleberg/atom-macos-context-menu.md
“Open in Atom” in macOS context-menu

Open in Atom

  • Open Automator
  • Create a new Service
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
  • Set the script action to /usr/local/bin/atom -n "$@"
  • Set “Pass input” to as arguments
  • Save as Open in Atom
@matthewhudson
matthewhudson / streamDecodedVideo.js
Created May 25, 2019 08:14 — forked from yoannmoinet/streamDecodedVideo.js
Stream video back in correct format.
import ffmpeg form 'fluent-ffmpeg';
const filePath = '/Users/yoann/Desktop/video.avi';
const route = (req, res) => {
res.writeHead(200, getHeaders({'Content-Type': 'video/mp4'}));
ffmpeg(filePath)
.format('mp4')
.addOptions([
'-movflags frag_keyframe+faststart'
])
import uuid
import hashlib
import base64
def generate_unique_id():
return base64.b32encode(
hashlib.sha256(uuid.uuid4().bytes).digest())[:12].lower()
def generate_access_token():
return base64.b32encode(hashlib.sha256(uuid.uuid4().bytes).digest())[:52]
Verifying that +matthewhudson is my openname (Bitcoin username). https://onename.io/matthewhudson
@matthewhudson
matthewhudson / devicejs-refactor.js
Last active December 21, 2018 16:08
First pass at a device.js refactor from CoffeeScript to JavaScript
/*jslint browser: true, indent: 2 */
'use strict';
// Device.js
// (c) 2014 Matthew Hudson
// Device.js is freely distributable under the MIT license.
// For all details and documentation:
// http://matthewhudson.me/projects/device.js/