Skip to content

Instantly share code, notes, and snippets.

View mplewis's full-sized avatar
🐕
柴犬

Matt Lewis mplewis

🐕
柴犬
View GitHub Profile
{
"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)
;
@mplewis
mplewis / bubblesort-int-list.scm
Created April 3, 2014 10:27
This is a bubblesort algorithm written in Scheme. It sorts a list of integers from least to greatest.
(define (re)
(load "bubblesort-int-list.scm"))
(define (sort-list origlist)
(define (get-first a b)
(if (< a b)
a
b))
(define (get-second a b)
(if (< a b)
@mplewis
mplewis / lastfm-analysis.ipynb.json
Last active August 29, 2015 13:58
Exporting your Last.fm history into an SQLite DB for analysis
{
"metadata": {
"celltoolbar": "Raw Cell Format",
"name": "",
"signature": "sha256:322a2974ad58e39abb5e8cfd03bfb8a7a1dda552cc215255577037e09b5195fc"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
@mplewis
mplewis / Polygon contains point.ipynb
Created April 29, 2014 09:50
Demonstration of polygon contains point algorithm for Usafe use
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
var fs = require('fs');
var path = require('path');
var glob = require('glob');
var async = require('async');
var Client = require('./client').Client;
var client = new Client();
function cp2remote(src, dest, callback) {
client.parse(dest);