Skip to content

Instantly share code, notes, and snippets.

View mplewis's full-sized avatar
🐕
柴犬

Matt Lewis mplewis

🐕
柴犬
View GitHub Profile
@mplewis
mplewis / dotabuff_matchup_scraper.ipynb.json
Created January 1, 2014 23:57
Scrape Dotabuff statistics for Dota 2 hero-vs-hero matchup details.
{
"metadata": {
"name": "Dotabuff Scrape Heroes"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@mplewis
mplewis / docker_tricks.md
Last active January 3, 2016 10:09
How to deploy with GitHub, CI, and Docker, if you're into that

Stupid Docker Tricks

Create a docker group

sudo groupadd docker
sudo chgrp docker /var/run/docker.sock
@mplewis
mplewis / sample_docker_deploy.sh
Last active January 3, 2016 10:09
Deploy @thenewtricks hello-world-nodejs with Docker
#!/bin/sh
# Verbose mode
set -o verbose
# Get the repo to working condition
cd ../docker-hello-world-nodejs
git checkout -f master
git pull
@mplewis
mplewis / config.js
Last active January 3, 2016 10:09
Hook to Deploy config for Docker deploys
var util = require('util');
var port = 4728;
var hooks = {
helloworld: {
key: 'DEADBEEFCAFE',
action: function(req, res) {
var to_exec = '../deploy-scripts/deploy-helloworld.sh';
require('child_process').exec(to_exec, function(error, stdout, stderr) {
{
"title": "Pet animals",
"sections": [
{"seconds": 60, "topic": "Kittens"},
{"seconds": 20, "topic": "Puppies"},
{"seconds": 30, "topic": "Birdies"},
]
}
[{"title":"Favorite pets","sections":[{"seconds":60,"topic":"Kittens"},{"seconds":20,"topic":"Puppies"},{"seconds":30,"topic":"Birdies"}]},{"title":"Deadly animals","sections":[{"seconds":29,"topic":"Snakes"},{"seconds":255,"topic":"Sharks"}]},{"title":"Awesome foods","sections":[{"seconds":100,"topic":"Chaat"},{"seconds":601,"topic":"Pizza"},{"seconds":331,"topic":"Salmon"},{"seconds":33,"topic":"Filet mignon"}]}]
@mplewis
mplewis / pebble-post.js
Created February 15, 2014 22:24
Post to the Pebble Speaks server.
var newSpeech = { something: 'whatever' };
$.ajax({
type: 'POST',
url: 'http://pspk.kesdev.com/speeches',
data: JSON.stringify(newSpeech),
contentType: 'application/json',
dataType: 'json',
success: function(data){
console.log(data);
},
@mplewis
mplewis / Pokemon save parser.ipynb.json
Created March 6, 2014 06:22
An iPython Notebook for analyzing Pokemon Red/Blue saves
{
"metadata": {
"name": "Pokemon save parser"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@mplewis
mplewis / keybase.md
Created March 27, 2014 01:42
Keybase proof of identity for /mplewis

Keybase proof

I hereby claim:

  • I am mplewis on github.
  • I am mplewis (https://keybase.io/mplewis) on keybase.
  • I have a public key whose fingerprint is 89C9 FBD9 092B 0384 FD13 7935 267E 9D9E 7AEF C2B2

To claim this, I am signing this object:

@mplewis
mplewis / bubblesort-point-list.scm
Created April 3, 2014 10:26
This is a bubblesort algorithm written in Scheme. It is designed for the purpose of sorting a list of Cartesian points in the form (x . y), by distance from the origin (0 . 0) of a coordinate plane, in ascending order.
;;;;; Bubblesort Points by Ascending Distance from Origin
;;;;;; bubblesort-point-list.scm
;;;;;;; Matthew Lewis
;;;;;;;; Oct 24, 2011
;
; This is a bubblesort algorithm written in Scheme. It is designed for the purpose of sorting a list of Cartesian points in the form (x . y), by distance from the origin (0 . 0) of a coordinate plane, in ascending order.
;
; The main function is run as follows:
; (bubblesort-point-list pt-list)
;