Skip to content

Instantly share code, notes, and snippets.

View aaronpk's full-sized avatar

Aaron Parecki aaronpk

View GitHub Profile
@aaronpk
aaronpk / message.sql
Created May 25, 2014 18:24
The `message` table schema from chat.db
CREATE TABLE message (
ROWID INTEGER PRIMARY KEY AUTOINCREMENT,
guid TEXT UNIQUE NOT NULL,
text TEXT,
replace INTEGER DEFAULT 0,
service_center TEXT,
handle_id INTEGER DEFAULT 0,
subject TEXT,
country TEXT,
attributedBody BLOB,
$ webmention http://lionzan.me/2014-05-25/testing-webmentions/index.html
Finding links on http://lionzan.me/2014-05-25/testing-webmentions/index.html
Found 4 links:
http://lionzan.me
http://lionzan.me/2013-09-08/indiewebcamp-uk/
http://voxpelli.com/2013/12/webmentions-for-static-pages/
http://aaronparecki.com/articles/2014/03/23/1/posting-photos-on-my-own-site
http://lionzan.me
Discovered Webmention endpoint:
AppDelegate:33 [BG] Running version: 2.9.2 on iOS 7.1.1
AppDelegate:36 [BG] Uncaching data...
Whispr:97 [BG] Loading names: 0.010052
Whispr:546[BG] Unpacking logged in user...
Whispr:552 [BG] Found valid loggedInUser cache data
WhisprUser:67 [BG] User Id is a string, great.
Whispr:563 [BG] Found valid commentPositions cachedata
Whispr:578 [BG] Unpacking notifications...
Whispr:582 [BG] Found valid notifications cache data
AppDelegate:40 [BG] Initializing Mixpanel...
require 'terraformer'
require 'geotrigger'
require 'launchy'
require 'gist'
# create a new FeatureCollection
#
fc = Terraformer::FeatureCollection.new
# create a Geotrigger Application session with credentials stored in ~/.geotrigger under the :foo key
@aaronpk
aaronpk / webmention.conf
Created June 26, 2014 20:51
upstart script for webmention.io streaming server in node. Output ends up in /var/log/upstart/webmention.log
# webmention.io streaming
description "webmention.io streaming server"
start on runlevel [2345]
stop on runlevel [016]
respawn
exec /usr/local/bin/node /web/sites/webmention.io/streaming/webmention.js
Current challenge:
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJtZSI6Imh0dHA6Ly9hYXJvbnBhcmVja2kuY29tIiwidXNlcl9pZCI6MSwicHJvZmlsZV9pZCI6MzAzNCwicmVkaXJlY3RfdXJpIjoiaHR0cDovL2luZGlld2ViY2FtcC5jb20vU3BlY2lhbDpJbmRpZUF1dGg_cmV0dXJudG89TWFpbl9QYWdlIiwic3RhdGUiOm51bGwsInNjb3BlIjpudWxsLCJub25jZSI6MTExODU4LCJjcmVhdGVkX2F0IjoxNDA0NDMyMzQ1fQ.fyd2XE5-4Rf_EfPZzHc_Y3yOmyr8x_7soWvAJS644rY
Decoded challenge payload:
{"me":"http://aaronparecki.com","user_id":1,"profile_id":3034,"redirect_uri":"http://indiewebcamp.com/Special:IndieAuth","state":"","scope":"","nonce":"4000000"}
I could rewrite this challenge to human-readable key/value pairs:
@aaronpk
aaronpk / set_dates.rb
Created July 6, 2014 20:42
An untested script to change the upload date of your Flickr photos to the date the photo was taken
require 'flickraw'
FlickRaw.api_key = ''
FlickRaw.shared_secret = ''
@flickr = FlickRaw::Flickr.new
@flickr.access_token = ''
@flickr.access_secret = ''
# Test if the access token is valid
<h2>Multipart</h2>
<form action="/upload" enctype="multipart/form-data" method="post">
<input type="text" name="title"><br>
<input type="file" name="upload" multiple="multiple"><br>
<input type="submit" value="Upload">
</form>
<hr>
<h2>Standard</h2>
@aaronpk
aaronpk / -90,45,180,90.txt
Last active August 29, 2015 14:04
Example disk-based storage of a QuadTree index. The index is built from the raw data in `data.csv`, resulting in the index txt files you see below. The index files contain pointers to their child nodes as well as a reference to the file and line number of the record. In this example, each node has a capacity of 4 data points.
nw:
ne:
sw:
se:
data.csv#5
mentions:
- source: https://brid-gy.appspot.com/like/instagram/aaronpk/779656243438275181_1500881/4956650
target: http://aaronparecki.com/notes/2014/08/04/1/
date_received: "2014-08-04 14:39:32"
type: like
- source: https://brid-gy.appspot.com/like/instagram/aaronpk/779656243438275181_1500881/14104640
target: http://aaronparecki.com/notes/2014/08/04/1/
date_received: "2014-08-04 15:56:12"
type: like
- source: https://brid-gy.appspot.com/like/instagram/aaronpk/779656243438275181_1500881/3686317