Skip to content

Instantly share code, notes, and snippets.

View MasterOdin's full-sized avatar

Matthew Peveler MasterOdin

View GitHub Profile
@MasterOdin
MasterOdin / watson-test.js
Last active May 27, 2020 17:50
watson text to speech stream
// npm install speaker wav
const TextToSpeechV1 = require('ibm-watson/text-to-speech/v1');
const Speaker = require('speaker');
const wav = require('wav');
const textToSpeech = new TextToSpeechV1({});
const sentences = [
'On a cool night lit only by the orange glow of fire, we rushed to my grandfather’s home as his decades-old barn burned to the ground. The firemen let us stand nearby as they pumped water from the creek a quarter mile away. We watched the barn go up in flames, which stirred memories of jumping off foot-wide wooden beams into the hay below. The real sadness came as my elderly grandfather, who did not get out of bed, quietly asked if his cows were safe. He hadn’t had dairy cows in a dozen years.',
From 0bae5587888cd251a14bd9068658a21fc7ba7ad2 Mon Sep 17 00:00:00 2001
From: Matthew Peveler <[email protected]>
Date: Mon, 23 Sep 2019 12:18:39 -0300
Subject: [PATCH 1/2] add __lt__ method for py2 old style class sort compat
---
scripts/build/output-distance.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/scripts/build/output-distance.py b/scripts/build/output-distance.py
@MasterOdin
MasterOdin / Dockerfile
Created June 25, 2018 10:52
asciidoc-alpine
# You can specify a specific python version of slim (based on Debian stretch, see https://hub.docker.com/_/python/)
# by doing --build-arg PYTHON_VERSION=<version> on the build command, and it defaults to Python 3.6
ARG PYTHON_VERSION=3.6
FROM python:${PYTHON_VERSION}-alpine
ENV GLIBC_VERSION 2.27-r0
ENV LILYPOND_VERSION 2.18.2-1
ENV DVISVGM_VERSION 2.4
ENV SOURCE_HIGHLIGHT_VERSION 3.1.8
@MasterOdin
MasterOdin / sample
Created April 19, 2017 13:15
init.d sample script
#!/bin/sh
### BEGIN INIT INFO
# Provides: sample
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
### END INIT INFO
@MasterOdin
MasterOdin / elevator.py
Created September 18, 2016 18:01 — forked from elliotchance/elevator.py
The Elevator Game
import random
import time
class Person:
WAITING = 0
IN_ELEVATOR = 1
DONE = 2
def __init__(self, from_floor, to_floor):
self.from_floor = from_floor
@MasterOdin
MasterOdin / LipsumGenerator.php
Created April 17, 2016 03:13
A PHP utility for generating Lorem Ipsum dummy text using the feed available from http://www.lipsum.com
<?php
namespace MasterOdin\Gists;
/**
* Class LipsumGenerator
* @package MasterOdin\Gists
*
* Provides a way to generate dummy text to be used on a page using
* http://www.lipsum.com as the generator. More convinent than
@MasterOdin
MasterOdin / AdjacencyChecker.java
Created February 29, 2016 20:38
Given a matrix of 1s and 0s, determine the adjacency of the 1s with each other. (Created to solve http://stackoverflow.com/questions/34524153/algorithm-or-java-code-for-searching-patterns-in-matrix)
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class AdjacencyChecker {
public static void main(String[] args) {
int[][] matrix = {{1,1,1,0,0},{1,0,0,0,1},{1,1,1,0,0},{0,0,0,1,1}};
List<Integer> list = new ArrayList<>();
for (int i = 0; i < matrix.length; i++) {
@MasterOdin
MasterOdin / .gitignore
Last active August 29, 2015 14:09
.gitignore template for all my projects
#==================
# OS X #
#==================
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
### Keybase proof
I hereby claim:
* I am MasterOdin on github.
* I am masterodin (https://keybase.io/masterodin) on keybase.
* I have a public key whose fingerprint is B60F B57C 9D18 D1AC 25A2 4BDD CA5E 164E 9A4E FBFB
To claim this, I am signing this object:
@MasterOdin
MasterOdin / cracker.py
Last active August 29, 2015 14:07
Brute Force Postgres Role Password Checker
import md5
import string
import time
'''
# Brute force solves a md5 hash (for a postgres user role)
# Assumes that password is only [a-zA-Z]
'''
def getNextCharacter(string,pos,characters):