Skip to content

Instantly share code, notes, and snippets.

View scripting's full-sized avatar

Dave Winer scripting

View GitHub Profile
@scripting
scripting / config.json
Last active October 29, 2018 17:05
Example config.json file for githubpub
{
"port": 1402,
"clients": {
"michigan": {
"id": "w7eonmdnlsnfysqjatl3",
"secret": "7i7h1iotnwzqqm4psjqtmgnvw2ga3rcki5kv52hb",
"urlEditorApp": "http://mysite.com/editor/"
}
},
"defaultNameCommitter": "Lawyer Boyer",
@scripting
scripting / demoriver.html
Created July 9, 2019 16:16
Template for your river, for testing by Anton.
<html>
<head>
<title>Demo River</title>
<link href="//fonts.googleapis.com/css?family=Ubuntu:400,500i,700" rel="stylesheet">
<link rel="stylesheet" href="//s3.amazonaws.com/scripting.com/code/fontawesome/css/all.css">
<script src="//s3.amazonaws.com/scripting.com/code/includes/jquery-1.9.1.min.js"></script>
<link href="//s3.amazonaws.com/scripting.com/code/includes/bootstrap.css" rel="stylesheet">
<script src="//s3.amazonaws.com/scripting.com/code/includes/bootstrap.min.js"></script>
<script src="//s3.amazonaws.com/scripting.com/code/includes/basic/code.js"></script>
<link href="//s3.amazonaws.com/scripting.com/code/includes/basic/styles.css" rel="stylesheet" type="text/css">
HTTP/1.1 200 OK
content-type: text/xml
date: Sun, 01 Sep 2019 19:44:33 GMT
connection: close
transfer-encoding: chunked
1f7
<?xml version="1.0"?>
<methodResponse>
<params>
@scripting
scripting / typicalXmlRpcServer.js
Created September 3, 2019 15:35
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.
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,
{
"name": "proxypersisttest",
"description": "A little test app that uses JavaScript proxy to manage a persistent stats object.",
"author": "Dave Winer <[email protected]>",
"license": "MIT",
"version": "0.4.0",
"dependencies" : {
"daveutils": "*"
}
}
{
"name": "test",
"description": "Test app for persists package.",
"author": "Dave Winer <[email protected]>",
"license": "MIT",
"version": "0.4.0",
"dependencies" : {
"persists": "*"
}
}
{
"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,
const urlRepo = "https://github.com/scripting/test2";
const localFolderPath = "myAppFolder/";
git.clone (urlRepo, localFolderPath, function (err) {
});
@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": ""
}
}
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