Skip to content

Instantly share code, notes, and snippets.

View dsblank's full-sized avatar
☄️
Head of Research, Comet.ml

Douglas Blank dsblank

☄️
Head of Research, Comet.ml
View GitHub Profile
@jdormit
jdormit / wordpress-activitypub.org
Last active March 12, 2022 04:23
Notes about an ActivityPub implementation for Wordpress

Technical details

The plugin will do two things: set up an ActivityPub server running on the Wordpress instance, and transform the Wordpress web interface (both admin and public, e.g. comments) into an ActivityPub client.

Objects and collections

I want to offload as much of the object storage as possible to existing Wordpress capabilities. This means that instead of storing separate objects for blog posts, comments, users, etc., the server translates the data already in the WP database to the correct JSON representation on-demand when it needs to interact with these objects. However, there may be some additional metadata that the server needs to associate with the existing representations, which can be done using linking tables (post_id -> recipients, etc.).

Collections (inboxes, outboxes, likes, follows, etc.) will probably need to have their own tables in the DB, since there’s not an obvious analog to these in classic WP.

I want the object created by the plugin to be compatible with Mastodon, whic

@waweic
waweic / my_flask_log.log
Created July 29, 2018 09:55
I think these are all files needed to understand my problem
* Serving Flask app "simple_python_activitypub"
* Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
127.0.0.1 - - [29/Jul/2018 10:58:44] "GET /users/waweic HTTP/1.0" 200 -
127.0.0.1 - - [29/Jul/2018 10:58:44] "GET /users/waweic HTTP/1.0" 200 -
127.0.0.1 - - [29/Jul/2018 10:58:44] "GET /.well-known/webfinger?resource=acct:waweic@testing1.ism.rocks HTTP/1.0" 200 -
@blink1073
blink1073 / do_complete.py
Last active August 29, 2015 14:06
MetaKernel do_complete
"""
Completions should be case-sensitive
There are three potential objects:
- the token we are in the middle of
- partial version of that token
- the prior token representing a function call
For completions, use the partial object
@nzjrs
nzjrs / caironumpy.py
Last active October 10, 2016 04:04
Mixing Cairo, Gtk, and numpy
# http://stackoverflow.com/a/10031877
import numpy
import cairo
import math
from gi.repository import Gtk,Gdk
data = numpy.zeros((200, 200, 4), dtype=numpy.uint8)
surface = cairo.ImageSurface.create_for_data(