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
Created July 30, 2015 12:20
An example of a PagePark config.json that redirects for a single document, and keeps serving the others as before. See change notes for v0.67.
{
"redirects": {
"/outlinerhowto.html": "http://fargo.io/docs/outlinerHowto.html"
}
}
@scripting
scripting / config.json
Created August 21, 2015 13:57
Example of a config.json for River4 that tells it to watch for quitnow.txt. Part of v0.119.
{
"flWatchForQuitFile": true
}
@scripting
scripting / config.json
Created August 21, 2015 20:27
config.json for River4 v0.120
{
"flWatchAppDateChange": true,
"fnameApp": "river4.js"
}
@scripting
scripting / index.html
Last active September 10, 2015 13:02
Source code for mlbriver.com
This page has moved to --
https://gist.github.com/scripting/be89904f454086103eb5
Still diggin! ;-)
Dave
@scripting
scripting / mlbriver.html
Last active September 30, 2016 02:06
Source code for mlbriver.com v2
<html>
<head>
<title>mlbriver.com</title>
<!--
This is a lightly modified version of the source for mlbriver.com.
I took out the hit counting code, because that's specific to the way I run my sites.
@scripting
scripting / aboutdialog.html
Last active September 14, 2015 02:12
Example source for the About dialog for a river of news page.
<html>
<head>
<title>aboutdialog test</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="http://fargo.io/code/jquery-1.9.1.min.js"></script>
<link href="http://fargo.io/code/bootstrap.css" rel="stylesheet">
<script src="http://fargo.io/code/bootstrap.min.js"></script>
<link rel="stylesheet" href="http://fargo.io/code/fontAwesome/css/font-awesome.min.css"/>
function includeScriptCode (url, callback) {
var head = document.getElementsByTagName ("head") [0];
var x = document.createElement ("script");
x.src = url;
if (callback !== undefined) {
x.onload = callback;
}
head.appendChild (x);
}
function useStylesheet (url) {
var head = document.getElementsByTagName ("head") [0];
var styleSheet = document.createElement ("link");
styleSheet.rel = "stylesheet";
styleSheet.type = "text/css";
styleSheet.href = url;
head.appendChild (styleSheet);
}
<html>
<head>
<title>WebSocket client example</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="http://fargo.io/code/jquery-1.9.1.min.js"></script>
<link href="http://fargo.io/code/ubuntuFont.css" rel="stylesheet" type="text/css">
<script>
var urlMySocket = "ws://localhost:1337/";
var ctSeconds = 0;
var ws = require ("nodejs-websocket");
var myPort = 1337;
function handleConnection (conn) {
conn.on ("text", function (s) {
var returnstring = s.toUpperCase () + "!!!";
console.log ("handleConnection: returning " + returnstring);
conn.sendText (returnstring)
});
}