Skip to content

Instantly share code, notes, and snippets.

Dave Winer scripting

Block or report user

Report or block scripting

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gitCloneSnippet.js
const urlRepo = "";
const localFolderPath = "myAppFolder/";
git.clone (urlRepo, localFolderPath, function (err) {
View sharedObjectExample.json
"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,
View package.json
"name": "test",
"description": "Test app for persists package.",
"author": "Dave Winer <>",
"license": "MIT",
"version": "0.4.0",
"dependencies" : {
"persists": "*"
View package.json
"name": "proxypersisttest",
"description": "A little test app that uses JavaScript proxy to manage a persistent stats object.",
"author": "Dave Winer <>",
"license": "MIT",
"version": "0.4.0",
"dependencies" : {
"daveutils": "*"
scripting / typicalXmlRpcServer.js
Created Sep 3, 2019
This is a typical XML-RPC server written in JavaScript as of today. There's still more cleanup to do, for example, you shouldn't have to specify flPostEnabled in config, since XML-RPC calls are only made via POST, it can be handled at the lower level.
View typicalXmlRpcServer.js
const xmlrpc = require ("davexmlrpc");
const utils = require ("daveutils");
const davehttp = require ("davehttp");
const mail = require ("davemail");
const fs = require ("fs");
var config = {
port: 1417,
flPostEnabled: true,
flLogToConsole: true,
View response.txt
HTTP/1.1 200 OK
content-type: text/xml
date: Sun, 01 Sep 2019 19:44:33 GMT
connection: close
transfer-encoding: chunked
<?xml version="1.0"?>
scripting / demoriver.html
Created Jul 9, 2019
Template for your river, for testing by Anton.
View demoriver.html
<title>Demo River</title>
<link href="//,500i,700" rel="stylesheet">
<link rel="stylesheet" href="//">
<script src="//"></script>
<link href="//" rel="stylesheet">
<script src="//"></script>
<script src="//"></script>
<link href="//" rel="stylesheet" type="text/css">
scripting / config.json
Last active Oct 29, 2018
Example config.json file for githubpub
View config.json
"port": 1402,
"clients": {
"michigan": {
"id": "w7eonmdnlsnfysqjatl3",
"secret": "7i7h1iotnwzqqm4psjqtmgnvw2ga3rcki5kv52hb",
"urlEditorApp": ""
"defaultNameCommitter": "Lawyer Boyer",
scripting / yamlize.js
Last active Sep 23, 2018
Convert between YAML and JSON and vice versa
View yamlize.js
const utils = require ("daveutils");
const yaml = require ("js-yaml");
function yamlIze (jsontext) {
var jstruct = JSON.parse (jsontext);
const delimiter = "---\n";
var text = jstruct.text;
delete jstruct.text;
var s = delimiter + yaml.safeDump (jstruct) + delimiter + text;
scripting / package.json
Last active Sep 12, 2018
Getting the contents of a GitHub repository using the contents API
View package.json
"name": "repocontents",
"description": "Code to get the contents of a respository.",
"author": "Dave Winer <>",
"version": "0.4.0",
"main": "repocontents.js",
"scripts": {
"start": "node repocontents.js"
"dependencies" : {
You can’t perform that action at this time.