Skip to content

Instantly share code, notes, and snippets.

Avatar

Matthew Hudson matthewhudson

View GitHub Profile
View README.md

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 Jan 13, 2021
It's ok to...
View itsokto.md

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 Sep 17, 2019
OMG & @webpipe/server interface idea
View index.js
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 Aug 14, 2019
Planets Nav - CPC Fork This
View index.html
<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 Jun 19, 2019
CSS Custom Properties
View style.css
/*
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 — forked from idleberg/atom-macos-context-menu.md
“Open in Atom” in macOS context-menu
View atom-macos-context-menu.md

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 — forked from yoannmoinet/streamDecodedVideo.js
Stream video back in correct format.
View streamDecodedVideo.js
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'
])
View gist:8a3718955b4143c1d7be
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]
View gist:0ac920dd4cb38c0ac80d
Verifying that +matthewhudson is my openname (Bitcoin username). https://onename.io/matthewhudson
@matthewhudson
matthewhudson / devicejs-refactor.js
Last active Dec 21, 2018
First pass at a device.js refactor from CoffeeScript to JavaScript
View devicejs-refactor.js
/*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/