Skip to content

Instantly share code, notes, and snippets.

View brett-miller's full-sized avatar

Brett Miller brett-miller

  • Expedia
  • Seattle
View GitHub Profile
@brett-miller
brett-miller / .block
Created September 4, 2016 20:21 — forked from mbostock/.block
Dispatching Events
license: gpl-3.0
navigator.requestMIDIAccess().then(
onMIDIInit,
onMIDISystemError );
var count = 0;
var data = [];
function logIt(it){
if (count < 100 && it.data.length > 1) {
console.log(it.data);
count++;
}
@brett-miller
brett-miller / .block
Last active April 7, 2017 05:56 — forked from mbostock/.block
Contour Plot
license: gpl-3.0
height: 673
border: no
@brett-miller
brett-miller / test.stl
Created April 17, 2017 17:49 — forked from bellbind/test.stl
[STL]test to upload STL file on gist
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@brett-miller
brett-miller / .block
Created April 17, 2017 17:57 — forked from mbostock/.block
GeoJSON in Three.js
license: gpl-3.0
height: 960
border: no
/**
* @author Eberhard Graether / http://egraether.com/
*/
THREE.TrackballControls = function ( object, domElement ) {
var _this = this;
var STATE = { NONE: -1, ROTATE: 0, ZOOM: 1, PAN: 2, TOUCH_ROTATE: 3, TOUCH_ZOOM: 4, TOUCH_PAN: 5 };
this.object = object;
@brett-miller
brett-miller / man-section-count.sh
Created April 22, 2017 05:21
count of man pages by section
#!/bin/sh
# apropos . - whatis database
# sed 's/\s*\(.*\)-.*/\1/' - remove content to the right of '-'
# sed -e $'s/,/\\\n/g' - split likes on ','
# grep \(.*\) - remove lines without a section
# sed 's/[^)]*(\([^)]*\)).*/\1/' - extract the section string
# awk '{arr[$1]++}END{for (a in arr) print a, arr[a]}' - get count of each section ($1)
# sort -nrk2 - sort by number in reverse order on column 2
# column -t - format in readable columns
@brett-miller
brett-miller / .block
Created May 23, 2017 23:02 — forked from mbostock/.block
Partition
license: gpl-3.0
height: 4980
@brett-miller
brett-miller / Untitled-1
Created March 3, 2018 03:59
0 to 10 addition math facts
with open("math_facts.txt","w") as math_facts_file:
for i in range(0,11):
for j in range(0,11):
math_facts_file.write("{i} + {j}".format(i=i, j=j) + "\n")
- hosts: all
environment:
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
PATH: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
tasks:
- name: "task name"
command: pipenv run python script.py