Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"secret": "1234abcd", | |
"source": "http://rhiaro.co.uk/2015/11/1446953889", | |
"target": "http://aaronparecki.com/notes/2015/11/07/4/indiewebcamp", | |
"post": { | |
"type": "entry", | |
"author": { | |
"name": "Amy Guy", | |
"photo": "http://webmention.io/avatar/rhiaro.co.uk/829d3f6e7083d7ee8bd7b20363da84d88ce5b4ce094f78fd1b27d8d3dc42560e.png", | |
"url": "http://rhiaro.co.uk/about#me" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$wgExtensionFunctions[] = "relWebmention"; | |
$wgExtensionCredits['parserhook'][] = array( | |
'name' => 'Rel Webmention', | |
'author' => 'Aaron Parecki http://aaronparecki.com', | |
'description' => 'Adds <nowiki><link rel="webmention"></nowiki> tag to advertise a Webmention endpoint on every page', | |
'url' => 'https://gist.github.com/aaronpk/7de5b63c58bc00e9e2cda434432ed0d3' | |
); | |
function relWebmention() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$html = '<html><body><a href="http://example.com">example</a></body></html>'; | |
$lookfor = 'http://example.com'; | |
$doc = new DOMDocument(); | |
libxml_use_internal_errors(true); # suppress parse errors and warnings | |
$body = mb_convert_encoding($html, 'HTML-ENTITIES', mb_detect_encoding($html)); | |
@$doc->loadHTML($body, LIBXML_NOWARNING|LIBXML_NOERROR); | |
libxml_clear_errors(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"uid": "twitter::kylewmahan", | |
"name": "@kylewmahan on Twitter", | |
"service": { | |
"name": "Twitter", | |
"photo": "https://abs.twimg.com/favicons/favicon.ico", | |
"url": "https://twitter.com/" | |
}, | |
"user": { | |
"name": "Kyle Mahan", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh -R 6080:localhost:80 tunnlr.xyz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$input = json_decode(file_get_contents('php://input')); | |
if($input && property_exists($input, 'items') && count($input->items)) { | |
$item = $input->items[0]; | |
$url = $item->permalinkUrl; | |
$ch = curl_init('https://telegraph.p3k.io/webmention'); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POST /micropub HTTP/1.1 | |
Content-type: multipart/form-data; boundary=1884ea44ff5ec7421c3becf56820d9e0 | |
Authorization: Bearer xxxxxxxxxx | |
--1884ea44ff5ec7421c3becf56820d9e0 | |
Content-Disposition: form-data; name="h" | |
entry | |
--1884ea44ff5ec7421c3becf56820d9e0 | |
Content-Disposition: form-data; name="content[html]" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import serial | |
ser = serial.Serial('/dev/ttyUSB0', 9600, 8, serial.PARITY_NONE, serial.STOPBITS_ONE) | |
print("turning tv off") | |
ser.write("801s!000\x0D") | |
print("reading reply") | |
response = ser.read(4) | |
print("%s" % response) |