Skip to content

Instantly share code, notes, and snippets.

View trevmex's full-sized avatar
👨‍👩‍👧‍👦

Trevor Menagh trevmex

👨‍👩‍👧‍👦
View GitHub Profile
window.braindead.beep = new Audio("data:audio/wav;base64,UklGRpCaBgBXQVZFZm10IBAAAAABAAIARKwAABCxAgAEABAAZGF0YWyaBgDv/+3/5f/s/9j/6//S/+//xP/s/7v/8f+q/+7/pf/p/5z/4v+f/9L/of/P/6L/wP+m/8H/nv+4/6T/t/+j/7L/qP+v/63/rv+q/6v/p/+s/6P/qf+e/6f/pP+n/6r/q/+v/7D/tv+0/7v/t/+4/7n/uf+3/7P/wP+0/7r/pv+9/6T/sf+N/6v/hv+f/3b/nP93/5j/c/+Y/2z/k/9h/5H/Tf+L/0H/iv83/4b/Mv+E/zL/ef8s/3H/Jv9m/yf/YP8j/2P/L/9k/y//af87/2j/Qf9n/1P/bf9m/3L/ff94/4z/gP+a/4L/pv+I/7r/i//J/5f/4/+c/+r/qv/7/7D//P+5/wYAxv8RAM7/GADg/yIA5v8dAO7/FQD5/xAAAAADAA8ABwAYAAQAIQAKACYADAAlABMAJQAcACgAKQAtADoAOQBJAEAAWgBLAGgAUwB1AFcAfQBkAIQAZwCJAG8AkwB4AJYAdwClAIMApQCMAK0AkgCtAKIArgCdALoAowC2AJoAwQCZAL0AkwC6AJMAtACRAKgAjwClAJEAmQCQAJ0AkQCSAJUAkgCPAIgAkACGAI0AdQCFAHcAggBrAHMAbgByAHAAZgBvAGsAdgBgAHEAagB3AGUAcgBpAHIAawBwAGkAcgBwAHYAagCBAHcAhgBrAI8AcgCNAGsAkQBrAIkAbwCJAG8AgQByAH4AcwB1AHMAcwBzAG4AdgByAHsAdwB9AHUAhwB1AIYAbgCPAHIAjQBwAJcAdwCXAHYAlwBzAJIAbACMAGcAhQBgAIEAYQCCAGEAgwBgAH8AXwB8AFgAdABPAHAASQBsAD4AZAA9AF4AOQBYADUAUAAuAEYAJQA+AB4ALQAXACEAEQATAAcAAwD1//v/5P/v/9D/6//G/+T/uv/k/7n
This file has been truncated, but you can view the full file.
window.braindead.beep = new Audio("data:audio/wav;base64,UklGRpBCDgBXQVZFZm10IBAAAAABAAIARKwAABCxAgAEABAAZGF0YWxCDgD9/wwAAQAVAAUAHwALACMAEgAlABIAJQAVACUADwAwABAAOQASAEgAGQBJAB0AUQApAEwAJABUACYAUgAkAFYAJgBUAC0AUgAxAEwAMABHACoARAAiAEUAHABDAB8APwAeAD8AKAA2ACUAOAAuADEALgA1ADcANAA9AD0ASwA9AE0ARgBSAD4AWQBEAFQAOQBfADsAXgA7AGMAOQBkAEEAZQA5AGQAPQBpADcAaAA3AG8ANABrAC8AZQAzAFgAKgBJADIAPwApADIAKgAuACYAJAAjACEAHwAaABkAEQAXABAAEQAGAA4AAwAFAPf/AgD1//b/7P/0//T/5v/u/+f/8v/b//L/2//t/9X/7//P/+z/zv/s/8b/7v/D//H/wv/u/73/8//B/+r/v//r/8n/5v/G/+j/0//o/83/7P/S//D/xf/y/8z//P/H/wEA0f8JANT/CwDd/wgA2v8KAOT/DADi/xoA7v8lAPf/NgD7/z4ACABCAAoATQASAE8AIQBhACgAZAA1AHIAPwB2AEQAfgBPAIIAUQB9AFoAfABfAHEAXgB2AGkAdQBkAHgAawBzAGYAbABkAGUAZgBhAGMAZgBrAGwAawB2AG8AewBpAH0AZwCAAGQAfwBhAIIAagB/AGsAgQB1AH4AcwCDAHoAfgB4AIQAgACFAHsAiACCAJIAeACOAIEAkwB+AIwAiQCSAIkAkwCSAKIAlgCqAJwAsQCiALIAqQCyAKgAsACtAKwArACvAKsArgCzALUAsQC3AL0AtAC3AK0AtQCmAKwAmQCiAJ4AoQCYAKEApgCgAKYAoACnAJ0AogCYAJgAmQCTAJQAlACZAJYAkgCVAI8AlwCGAI0AhACQAIEAiQCHAIwAiACKAIcAigCIAIQAfgB9AHwAdAB5AG4
@trevmex
trevmex / magiquest_caseta_arduino_light_toggle.ino
Last active July 10, 2018 01:26
Arduino code to toggle your lights on and off using a Magiquest wand. Schematics and instructions are available at http://fritzing.org/projects/magiquest-caseta-arduino-light-toggle
/*
Copyright 2017 Trevor Menagh
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
words = File.readlines("/usr/share/dict/words").map(&:chomp).map(&:downcase)
words.reject! { |word| word.length > 7 }
line = ('a'..'z').to_a.sample(7)
puts line.join(", ")
perm = (1..7).inject([]) { |acc, n|
acc + line.permutation(n).to_a
}
### Keybase proof
I hereby claim:
* I am trevmex on github.
* I am trevmex (https://keybase.io/trevmex) on keybase.
* I have a public key whose fingerprint is 9E7E 1FCC 1894 727B E845 ADC9 F105 E554 39A1 A7D9
To claim this, I am signing this object:
@trevmex
trevmex / hal+metadata.json
Created May 1, 2014 01:16
An example of HAL JSON with Schema.org Metadata
{
"_type": "http://schema.org/QuantitativeValue/ProcessableOrders",
"_links": {
"self": { "href": "/orders" },
"curies": [{ "name": "ea", "href": "http://example.com/docs/rels/{rel}", "templated": true }],
"next": { "href": "/orders?page=2" },
"ea:find": {
"href": "/orders{?id}",
"templated": true
},
@trevmex
trevmex / 10.9.1.txt
Last active August 29, 2015 13:57
Mac OS X build failure for gs-rest-service
$ uname -a
Darwin 13.0.0 Darwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 PDT 2013; root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64
$ java -version
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
$ mvn -version
Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 11:22:22-0400)
Maven home: /usr/local/Cellar/maven/3.1.1/libexec
Java version: 1.6.0_65, vendor: Apple Inc.
@trevmex
trevmex / .vimrc
Created September 30, 2013 16:23
My first VimL function. It removes all matched lines in a file. Woohoo!
" :RL <regexp> will now remove all matched lines in a file
function! RemoveLine(regexp)
exe '%s,^.*' . a:regexp . '.*$\n,,g'
endfunction
command! -nargs=1 RL call RemoveLine(<f-args>)
@trevmex
trevmex / cd.sh
Last active December 20, 2015 19:19
A shell script to read in the env.* variables from a .versions.conf file and replace them while in this directory only. Restores them on exit. This is meant to override `cd.` TODO: Make the cd command actually work...
#!/usr/bin/env bash
###
# cd override
#
# This replaces the builtin cd command
###
function init_local_env() {
SAVED_VAR=ENV$(echo $1 | sed -e s:/:_:g | tr "[:lower:]" "[:upper:]")_SAVED
@trevmex
trevmex / proposal.json
Created December 20, 2012 14:34
A proposal for allowing multiple CURIEs in HAL for use in values as well as keys.
{
"_links": {
"self": { "href": "/" },
"curies": [{
"name": "ex",
"href": "http://www.example.com/rels/{rel}",
"templated": true
},
{
"name": "ot",