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
@scripting
scripting / credentials
Created May 23, 2020
Example of an AWS credentials file (with random strings in place of actual values)
View credentials
[default]
aws_access_key_id=udafkgisftiaoo4j37xv
aws_secret_access_key=kxx6njofyi37wvix2ncask8f5gs5dt3qfi2qucyg
@scripting
scripting / example.sh
Created Apr 28, 2020
Run an AWS command line script from a Node app (demo)
View example.sh
#!/bin/sh
aws s3 cp example.sh s3://scripting.com/tmp/example.sh --acl public-read
@scripting
scripting / runfilterscript.js
Created Apr 22, 2020
Chuck this is how I run filter scripts. I probably will convert to requireFromString.
View runfilterscript.js
function runFilterScript (host, callback) { //3/23/20 by DW
var f = getFullFilePath (domainsPath) + host + filterFname;
fs.readFile (f, function (err, data) {
if (err) {
callback (false); //file doesn't exist -- we didn't run the filter script
}
else {
try {
const options = {
httpRequest,
View mymodule.js
exports.helloWorld = function () {
return ("hello world");
}
@scripting
scripting / zipExample.js
Last active Apr 12, 2020
Psuedocode for how I'd like zip archivng to work. It gives me full JS to decide if a file belongs or doesn't.
View zipExample.js
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 Apr 11, 2020
A PagePark config.json file demonstrating the use of mirrors
View config.json
{
"mirrors": {
"/": "http://scripting.com/images/2020/04/11/driveway.png"
}
}
@scripting
scripting / filter.js
Last active Apr 2, 2020
Example of a PagePark plug-in
View filter.js
//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 Feb 6, 2020
The keyboard manager for the upcoming version of Concord.
View concordkeyboard.js
// 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",
View gist:c4ee12eeacfff323bba67fc4fe662d73
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>
		<methodName>examples.getStateName</methodName>
@scripting
scripting / config.json
Created Dec 5, 2019
A config.json for serving a site from a GitHub repository.
View config.json
{
"githubServeFrom": {
"username": "scripting",
"repository": "pagePark",
"path": ""
}
}
You can’t perform that action at this time.