Skip to content

Instantly share code, notes, and snippets.

View gobengo's full-sized avatar

Benjamin Goering gobengo

View GitHub Profile
>>> class X:
... pass
...
>>> @classmethod
... def mysum(cls, x, y):
... return x + y
...
>>> X.setattr('s', mysum)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
@gobengo
gobengo / GraphMatrix
Created January 21, 2011 06:20
Check it out
Imagine graph G with vertexes A, B, C (sketch this if that's your thing). G has the following directed edges:
A->B
B->C
C->A
Basically this is a triangle with a loop. Now, let's say we model this with a binary matrix. Edge A->B means that G[A][B]=1. Similarly: G[B][C], G[C][A] = 1, 1. Think about this 2D array as a matrix G1:
ABC
A010
B001
C100
@gobengo
gobengo / node-gchat.js
Created January 22, 2011 06:17
node.js-driven Google Chat bot
var xmpp = require('node-xmpp'),
secret = require('./secret'),
util = require('util');
var creds = {
jid: 'bengoering@gmail.com',
password: secret.pw, //string
};
var GChat = function(creds) {
@gobengo
gobengo / index.html
Created December 12, 2011 19:03 — forked from ninowalker/server.py
A simple web server in two (three) steps
<html>
<head></head>
<body>
<p>Hello, world!</p>
</body>
</html>
@gobengo
gobengo / gist:2731289
Created May 19, 2012 15:48 — forked from clintel/gist:1155906
Fenced code in bullet lists with GitHub-flavoured MarkDown??

Fenced code blocks inside ordered and unordered lists

  1. This is a numbered list.

  2. I'm going to include a fenced code block as part of this bullet:

    Code
    More Code
    
@gobengo
gobengo / content.json
Created January 14, 2013 05:44
StreamHub-Backbone Content Properties
{
"id": "1fe8d2f7-4266-4830-af03-a389ca86f31b",
"event": 1.3575080009429e+15,
"bodyHtml": "Bonne rentr\u00e9e , rien qu'a dire ces 2mots j'ai envie de chialer.\n#va#retrouver#ces#deux#amour#Marie#laurette. ",
"ancestorId": "1fe8d2f7-4266-4830-af03-a389ca86f31b",
"annotations": {
},
"authorId": "0fb0638b4b1ef064d1086f6522d5743f@instagram.com",
"createdAt": 1357508000,
@gobengo
gobengo / xsdDateTime.js
Created June 8, 2015 23:08
JavaScript xsd:dateTime Parser
// built from definition: http://books.xmlschemata.org/relaxng/ch19-77049.html
var xsdDateTimePattern = new RegExp([
'(\\d{4})', //year
'-',
'(\\d{2})', // month
'-',
'(\\d{2})', // day
'T',
'(\\d{2})', // hour
':',

URN Resolver API

Many Livefyre APIs use Livefyre URNs as ids of the resources they describe.

The URN Resolver API allows a client to resolve a Livefyre URN to a related URL that describes or manages the resource indicated by the URN.

Use Cases

  • Given knowledge of a Livefyre Collection's Network, Site ID, and Article ID, I can create a link to manage that Collection in Livefyre Studio's web UI.
### Keybase proof
I hereby claim:
* I am gobengo on github.
* I am bengo (https://keybase.io/bengo) on keybase.
* I have a public key whose fingerprint is 3EFE C28D FEA1 955D CBFB 3B91 FAFE 5464 7D99 6E04
To claim this, I am signing this object:
{
"@context": "http://www.w3.org/ns/activitystreams#",
"id": "https://rhiaro.co.uk/2016/12/georgetown-wandering",
"type": "http://www.w3.org/ns/activitystreams#Article",
"content": "<p>Yesterday evening (21st) I went for a 'quick walk' into town. My apartment is about a 20 minute walk from the edge of George Town heritage area and 40 minutes from the jetty and core tourist zone. Between home and the edge of the 'nice' part of town is not particularly nice: apartment blocks, malls and big roads with... intermittent... footpaths. There are still lots of interesting places to stop of course; markets, stalls, local restaurants, general streetside chaos. Walking around here takes a lot of concentration, between trying to take in the surroundings, not being hit by scooters and cars, avoiding enormous open holes into the sewer, and not accidentally buying a kilo of tropical fruit every five minutes.</p>\r\n\r\n<p>The sky was blue. My goal was to procure coconut oil for cooking. I thought it would be easy to