Skip to content

Instantly share code, notes, and snippets.

View scripting's full-sized avatar

Dave Winer scripting

View GitHub Profile
@scripting
scripting / zipExample.js
Last active April 12, 2020 15:15
Psuedocode for how I'd like zip archivng to work. It gives me full JS to decide if a file belongs or doesn't.
const zip = require ("davezip");
const fs = require ("fs");
const theArchiveFile = zip.createArchive ('outlines.zip");
fs.fileloop ("/users/bullmancuso/publicfiles/", function (err, f) { //I made up fs.fileloop, it would be nice ;-)
if (f.hasExtension (".opml")) {
zip.addToArchive (f, theArchiveFile);
}
});
@scripting
scripting / config.json
Created April 11, 2020 15:24
A PagePark config.json file demonstrating the use of mirrors
{
"mirrors": {
"/": "http://scripting.com/images/2020/04/11/driveway.png"
}
}
@scripting
scripting / filter.js
Last active April 2, 2020 17:09
Example of a PagePark plug-in
//translate a url in this form: http://my.this.how/davewiner/example.opml
//to a file path like this: /root/apps/littleoutliner/publicFiles/users/davewiner/myOutlines/example.opml
exports.filter = filter;
const folder = "/root/apps/littleoutliner/publicFiles/users/";
function filter (options, callback) {
var url = options.httpRequest.url;
var splits = url.split ("?");
@scripting
scripting / concordkeyboard.js
Created February 6, 2020 18:14
The keyboard manager for the upcoming version of Concord.
// Copyright 2020, Dave Winer
// Copyright 2013, Small Picture, Inc.
var concordKeystrokes = {
"backspace": "backspace",
"tab": "tab",
"return": "return",
"delete": "delete",
"uparrow": "cursor-up",
"downarrow": "cursor-down",
POST /RPC2 HTTP/1.0
User-Agent: Frontier/5.1.2 (WinNT)
Host: betty.userland.com
Content-Type: text/xml
Content-length: 181
	
<?xml version="1.0"?>
	<methodCall>
 examples.getStateName
@scripting
scripting / config.json
Created December 5, 2019 22:38
A config.json for serving a site from a GitHub repository.
{
"githubServeFrom": {
"username": "scripting",
"repository": "pagePark",
"path": ""
}
}
const urlRepo = "https://github.com/scripting/test2";
const localFolderPath = "myAppFolder/";
git.clone (urlRepo, localFolderPath, function (err) {
});
{
"version": 1,
"metadata": {
"ctSaves": 41,
"whenLastSave": "9/8/2019, 10:21:01 AM",
"whenCreated": "9/8/2019, 10:19:39 AM"
},
"data": {
"mynum": 6,
"counter": 594,
{
"name": "test",
"description": "Test app for persists package.",
"author": "Dave Winer <dave@scripting.com>",
"license": "MIT",
"version": "0.4.0",
"dependencies" : {
"persists": "*"
}
}
{
"name": "proxypersisttest",
"description": "A little test app that uses JavaScript proxy to manage a persistent stats object.",
"author": "Dave Winer <dave@scripting.com>",
"license": "MIT",
"version": "0.4.0",
"dependencies" : {
"daveutils": "*"
}
}