Skip to content

Instantly share code, notes, and snippets.

View mattneary's full-sized avatar

Matt Neary mattneary

View GitHub Profile
class Expr(object):
def __init__(self, *args):
self.args = args
def rewrite(self, fn):
rewritten = map(fn, self.args)
if any(a is not b for a, b in zip(self.args, rewritten)):
return type(self)(*rewritten)
return self
Mimesis Recording
Title: mimesis
Mimesis Recording
Title: example

Automata

Automaton

  • Take a decimal number r whose binary representation is a 1d automaton ruleset.
  • Simulate n generations.
  • Output a visualization of the progression—ascii's fine.
var http = require('http');
var https = require('https');
var GROUP = '10237173'; // Get from another API call
var record = [];
function getMessages(token, res, offset) {
https.get("https://api.groupme.com/v3/groups/" + GROUP + '/messages?limit=100&token=' + token + (offset ? '&before_id=' + offset : ''), function (apiRes) {
var buffer = [];
apiRes.on('data', function (chunk) {
buffer.push(chunk);
});
This file has been truncated, but you can view the full file.
[
{
"repo": "Honors/HubChronos",
"commit_days": {
"8/13/2013": 3
}
},
{
"repo": "Honors/Elms",
"commit_days": {
let testObject = PFObject(className: "User")
testObject["name"] = "Matt"
testObject["location"] = "asdfasdfasdf"
testObject["id"] = "1"
testObject.saveInBackgroundWithBlock { (success: Bool, error: NSError?) -> Void in
println("Object has been saved.")
}
let testObject = PFObject(className: "Event")
testObject["for_user"] = "1"
@mattneary
mattneary / fetch.py
Last active August 29, 2015 14:24
Python Fetch Functor
import requests
import threading
# a -> ()
def out(x):
print x
def get(url, cb):
def work():
cb(requests.get(url).json())
return work
Mimesis Recording
Title: mimesis