Skip to content

Instantly share code, notes, and snippets.

View mattneary's full-sized avatar

Matt Neary mattneary

View GitHub Profile
This file has been truncated, but you can view the full file.
This file has been truncated, but you can view the full file.
This file has been truncated, but you can view the full file.
Mimesis Recording
Title: mimesis
Mimesis Recording
Title: mimesis
@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
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"
[
{
"repo": "Honors/HubChronos",
"commit_days": {
"8/13/2013": 3
}
},
{
"repo": "Honors/Elms",
"commit_days": {
This file has been truncated, but you can view the full file.
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);
});