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.

Mimesis Recording

Todo
The first priority is to convey the design to come. We will do that using animations, the new color scheme, and view *frames* which are loyal to the new design.
To speed things up, we will not implement all views according to the new designs. Some views very much lend themselves to being implemented in web views derived from existing designs.
Player Swipe View
Detail View should scale up and add WebView
Sidebar - animate natively with WebView contents
Filter View - just a WebView
Back and Forth Views - Make them modal
@mattneary
mattneary / clean-lists.rb
Last active August 29, 2015 14:22
Keep data on new items
master = ['X', 'Y']
def clean(list)
CSV.filter("#{list}.csv") do |row|
not (master.include? row[1])
end
end
['A', 'B', 'C'].each {|file|
clean(file)
}
@mattneary
mattneary / scrape.js
Last active August 29, 2015 14:20
GroupMe API scraper
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);
});
@mattneary
mattneary / poem.txt
Created May 1, 2015 02:39
Intimations of Immortality from Recollections of Early Childhood
Intimations of Immortality from Recollections of Early Childhood
By Wordsworth
I
THERE was a time when meadow, grove, and stream,
The earth, and every common sight,
To me did seem
Apparelled in celestial light,
The glory and the freshness of a dream.
It is not now as it hath been of yore;--
@mattneary
mattneary / kensho.js
Last active August 29, 2015 14:20
Interview
var marked = {};
function markPoint(matrix, x, y) {
marked[x+","+y] = true;
}
function isPointMarked(matrix, x, y) {
return marked[x+","+y];
}
function findNeighbors(matrix, x, y) {
return [-1, 0, 1].map(function (i) {
return [-1, 0, 1].map(function (j) {
#!/bin/bash
curl -s \
-d '{
"user": {
"email": "[email protected]",
"password": "password",
"password_confirmation": "password",
"profile_attributes": {
"gender": "m",
"name": "Matt Neary",
@mattneary
mattneary / ScheduleFinder.md
Last active August 29, 2015 14:05
A programming exercise.

Note that each command is preceded by $ to distinguish it from output; do not type the $.

We start with the data file.

$ cat data.txt
4|55504|214052
7|37107|214052
6|45206|214052
@mattneary
mattneary / fact.swift
Created July 30, 2014 15:24
Nested Recursive Functions Broken in Swift
func run() -> Int {
func fact(n : Int) -> Int {
return n == 0 ? 1 : n * fact(n-1)
}
return fact(3)
}
println(run())
// Gives the following error:
// Instruction does not dominate all uses!