Skip to content

Instantly share code, notes, and snippets.

View mesprague's full-sized avatar

Matthew Sprague mesprague

  • Denver, Colorado
View GitHub Profile

Keybase proof

I hereby claim:

  • I am mesprague on github.
  • I am mattsprague (https://keybase.io/mattsprague) on keybase.
  • I have a public key ASDbQndhauG7OwhVaqXZxRWzWFnES5xd2G4TXPzgnQoRCAo

To claim this, I am signing this object:

@mesprague
mesprague / export_repo_issues_to_csv.py
Created June 7, 2017 16:51 — forked from unbracketed/export_repo_issues_to_csv.py
Export Issues from Github repo to CSV (API v3)
"""
Exports Issues from a specified repository to a CSV file
Uses basic authentication (Github username + password) to retrieve Issues
from a repository that username has access to. Supports Github API v3.
"""
import csv
import requests
@mesprague
mesprague / bst.sh
Created February 10, 2017 00:24 — forked from iestynpryce/bst.sh
An implementation of a Binary Sort Tree in Bash. Object-like behaviour has been faked using eval. Remember that eval in shell scripting can be evil.
#!/bin/bash
#
# Binary search tree is of the form:
# 10
# / \
# / \
# 4 16
# / \ /
# 1 7 12
#
'use strict';
const from = require('from2');
const pIsPromise = require('p-is-promise');
module.exports = x => {
if (Array.isArray(x)) {
x = x.slice();
}
let promise;
var Readable = require('readable-stream').Readable
var shift = require('stream-shift')
var stream2 = function (stream) {
if (stream._readableState) return stream
return new Readable({objectMode: true, highWaterMark: 16}).wrap(stream)
}
module.exports = function (stream) {
stream = stream2(stream)
@mesprague
mesprague / formatjson.js
Created December 15, 2016 08:44 — forked from kristopherjohnson/formatjson.js
Read JSON from standard input and writes formatted JSON to standard output. Requires Node.js.
#!/usr/bin/env node
// Reads JSON from stdin and writes equivalent
// nicely-formatted JSON to stdout.
var stdin = process.stdin,
stdout = process.stdout,
inputChunks = [];
stdin.resume();
aursearch() {
http "https://aur.archlinux.org/rpc/?v=5" type==search arg==sddm
}
aurinfo() {
http "https://aur.archlinux.org/rpc/?v=5" type==info arg==sddm
}
@mesprague
mesprague / devalias.sh
Created May 20, 2016 07:32
Common Aliases for node development
alias pretty-pug="pug -P"
@mesprague
mesprague / Enum.es6.js
Created December 31, 2015 01:14 — forked from xmlking/Enum.es6.js
JavaScript Enums with ES6, Type Checking and Immutability
export class EnumSymbol {
sym = Symbol.for(name);
value: number;
description: string;
constructor(name: string, {value, description}) {
if(!Object.is(value, undefined)) this.value = value;
if(description) this.description = description;
@mesprague
mesprague / alx.sh
Last active August 29, 2015 14:09
Bash functions for arch linux
# search the Arch User Repository
alx-aur-search() { curl -s $(printf "https://aur.archlinux.org/rpc.php?type=search&arg=%s" $1) | jshon -e results; }
findowner() { local result = ($(pacman -Qo $1)); echo ${result[4]}; }