Skip to content

Instantly share code, notes, and snippets.

View scripting's full-sized avatar

Dave Winer scripting

View GitHub Profile
@scripting
scripting / githubResponse.json
Created June 25, 2021 14:28
This is what GitHub sends back when you upload a file via the API.
{
"content": {
"name": "now.txt",
"path": "misc/now.txt",
"sha": "ca4b31cc6e4a401ce43f78d94dd1e2b0f462c633",
"size": 11,
"url": "https://api.github.com/repos/scripting/instantOutlines/contents/misc/now.txt?ref=main",
"html_url": "https://github.com/scripting/instantOutlines/blob/main/misc/now.txt",
"git_url": "https://api.github.com/repos/scripting/instantOutlines/git/blobs/ca4b31cc6e4a401ce43f78d94dd1e2b0f462c633",
"download_url": "https://raw.githubusercontent.com/scripting/instantOutlines/main/misc/now.txt",
@scripting
scripting / ioGlue.ftsc
Created June 28, 2021 19:11
Script to run in UserLand Frontier or the OPML Editor to create instantoutliner glue
on createInstantOutlineGlue () {
local (apiUrl = "http://instantoutliner.com/createglue?", flfirst = true);
on pushparam (name, val) {
if not flfirst {
apiUrl = apiUrl + "&";};
apiUrl = apiUrl + name + "=" + string.urlencode (val);;
flfirst = false;
flfirst = false;};
pushparam ("url", "https://raw.githubusercontent.com/scripting/instantOutlines/main/outlines/scripting.opml");;
pushparam ("title", "Scripting News");;
@scripting
scripting / scriptingIncludes.opml
Last active July 16, 2021 17:03
An example outline for a Scripting News blog post
<?xml version="1.0"?>
<opml version="2.0">
<head>
<title>scriptingIncludes</title>
<dateCreated>Fri, 16 Jul 2021 15:33:52 GMT</dateCreated>
<dateModified>Fri, 16 Jul 2021 15:36:16 GMT</dateModified>
<ownerTwitterScreenName>davewiner</ownerTwitterScreenName>
<ownerName>Dave Winer</ownerName>
<ownerId>http://twitter.com/davewiner</ownerId>
<ownerEmail>[email protected]</ownerEmail>
@scripting
scripting / config.json
Created July 25, 2021 16:24
An example config.json for use with PagePark
{
"defaultExtension": "opml",
"mirrors": {
"/": "http://hosting.opml.org/dave/spec/states.opml"
}
}
@scripting
scripting / config.json
Last active July 26, 2021 02:45
A config.json file that serves files without extensions as markdown.
{
"defaultExtension": "md"
}
{"urlOpmlTemplate": "http://scripting.com/publicfolder/opml.org/opmltemplate.html"}
@scripting
scripting / code.js
Last active August 29, 2021 14:40
Local file-chooser dialog in HTML and JavaScript. This app opens a text file on the local computer and displays the file text in the JavaScript console.
function readFile (file) {
var url = window.URL.createObjectURL (file);
var reader = new FileReader ();
reader.onload = function (e) {
var filetext = reader.result;
console.log (filetext);
}
reader.readAsText (file);
}
function openDialogCommand (fileTypes) {
@scripting
scripting / credentials
Created October 12, 2021 16:34
Example of a Amazon credentials file, so Node apps can write to S3 (not actual passwords)
[default]
aws_access_key_id=tz4nhbttfvll76gb9ej7
aws_secret_access_key=cedx5jixadnwca1e3fnopkg8ji6cvynx4nlhgpy8
@scripting
scripting / gist:a71e0730a5f5ac89c2ff101aeba46856
Created October 21, 2021 20:32
An example of a config.json file for use with Drummer to store the Public Folder log on S3.
{
"watchFolder": "/Users/cluelessnewbie/publicFolder/",
"s3Folder": "/mybucket.com/publicfolder/",
"urlS3Folder": "http://mybucket.com/publicfolder/",
"flUploadLog": true,
"s3LogPath": "/mybucket.com/publicfolderlog.json"
}
@scripting
scripting / getCursorLink.js
Last active November 15, 2021 15:46
The source for the Drummer oldSchool.getCursorLink verb.