Skip to content

Instantly share code, notes, and snippets.

View matutter's full-sized avatar

Mat Utter matutter

View GitHub Profile
@matutter
matutter / Dockerfile
Last active March 28, 2016 00:07
dependencies for server
FROM alpine:latest
MAINTAINER matutter
RUN apk --no-cache add nodejs
RUN apk --no-cache add git
RUN mkdir /home/www
WORKDIR /home/www
ADD package.json
@matutter
matutter / nanomake.sh
Last active March 30, 2017 14:08
Includes all .nanorc files from /usr/share/nano
#!/bin/bash
# include all .nanorc files from /usr/share/nano
NANORC=~/.nanorc
SOURCE=/usr/share/nano
echo "# from nanomake.sh" > ${NANORC}
echo "set tabsize 2" >> ${NANORC}
echo "set tabstospaces" >> ${NANORC}
ls ${SOURCE} | grep .nanorc | while read FILE; do
@matutter
matutter / winston.test.js
Last active September 24, 2016 18:25
Trying to get winston to log into home path with a ~
// winston.version === '2.2.0'
var winston = require("winston")
var fs = require("fs")
var path = require("path")
function tryLog(filename, msg) {
var logger = new winston.Logger()
logger.add(winston.transports.File, {
filename: filename,
level : 'verbose',
@matutter
matutter / example.makefile
Created March 17, 2017 15:44
A makefile to make all intermediate objects and compile the a main executable
##
# Sources are expected to be layed out like so
# .
# ├── makefile
# └── src
# ├── hashing
# │   ├── hash.c
# │   └── hash.h
# └── main.c
#
@matutter
matutter / tmux_auto.sh
Last active March 30, 2017 12:43
Automatically connect to tmux session
##
# Check for TMUX session, create or attach "remote" session if connected through
# ssh or create or attach "local" session if connected through other means
HOST_SESSION_NAME="local"
SSH_SESSION_NAME="remote"
SESSION_NAME=$HOST_SESSION_NAME
if [ ! -n "$TMUX" ]; then
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
SESSION_NAME=$SSH_SESSION_NAME
fi
@matutter
matutter / install_antlr4.sh
Created April 7, 2017 19:01
Installs antlr4 on linux
#!/bin/bash
export ANTLR4_JAR=antlr-4.7-complete.jar
if ! type -p java; then
# Install Java 8
echo "Installing Java 8"
sudo add-apt-repository ppa:webupd8team/java
sudo apt updatee; sudo apt install oracle-java8-installer
@matutter
matutter / ansible.setup.md
Created July 13, 2017 00:52
Gist on setting up ansible on Ubuntu 16

Ansible Setup

  1. Add the ansible package repository sudo apt-add-repository ppa:ansible/ansible
@matutter
matutter / acrogen.js
Created September 13, 2017 02:59
Random acronym generator
var english_words = require('an-array-of-english-words');
function lookup(word) {
return english_words
.filter(x => { return x.startsWith(word); })
.sort((a, b) => { return 0.5 - Math.random(); });
}
function suggest(word, count, cb, constants) {
@matutter
matutter / example_test_case.py
Created February 5, 2018 01:57
Pocha, it looks like Mocha for python
##
# Example of using pocha, this might be good?
from pocha import describe, it
@describe('A feature')
def test_case():
@it('Should behave as expected when doing A')
def _():
@matutter
matutter / run-sfood.sh
Created February 10, 2018 21:56
snakefood example
#!/bin/bash
sfood pocha/ -i -r | sfood-graph -p | circo -Tsvg > this.svg