Skip to content

Instantly share code, notes, and snippets.

View scripting's full-sized avatar

Dave Winer scripting

View GitHub Profile
@scripting
scripting / pagetable.json
Created April 13, 2016 03:20
An example pagetable while the page is running, accessible from JavaScript code running in the page.
{
"productname": "bloatWare",
"productnameForDisplay": "BloatWare",
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."",
"urlTwitterServer": "http://localhost:1229/",
"urlPageTemplate": "/template.html",
"urlChatLogSocket": "ws://localhost:1230/",
"domain": "1999.io",
"nameChatLog": "davewiner",
"version": "0.88j",
@scripting
scripting / config.json
Last active May 13, 2016 15:09
A config.json for nodeStorage that specifies a homePage object.
{
"myPort": 1999,
"websocketPort": 2000,
"myDomain": "1999.bigbloat.io:1999",
"where": {
"flUseLocalFilesystem": true,
"publicPath": "publicFiles/",
"privatePath": "privateFiles/"
},
"homePage": {
@scripting
scripting / config.json
Last active May 17, 2016 14:25
Example of a config.json file with a plugIns section
{
"myPort": 1999,
"websocketPort": 2000,
"myDomain": "1999.bullmancuso.io:1999",
"where": {
"flUseLocalFilesystem": true,
"publicPath": "publicFiles/",
"privatePath": "privateFiles/"
},
"plugIns": {
@scripting
scripting / template.html
Last active May 26, 2016 15:27
Test version of the new default template for 1999.io
<html>
<head>
<title>[%title%]</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="alternate" type="application/rss+xml" href="[%urlRssFeed%]" />
<script src="http://1999.io/dev/publish/code.js"></script>
<link rel="stylesheet" href="http://1999.io/dev/publish/styles.css"/>
@scripting
scripting / config.json
Last active May 30, 2016 17:08
A config.json for nodeStorage that specifies a domains object.
{
"myPort": 1999,
"websocketPort": 2000,
"myDomain": "1999.bigbloat.io:1999",
"where": {
"flUseLocalFilesystem": true,
"publicPath": "publicFiles/",
"privatePath": "privateFiles/"
},
"domains": {
@scripting
scripting / disqusTemplate.html
Created June 18, 2016 10:44
A snippet of template code for 1999.io that adds Disqus comments to your story pages.
<div class="divDisqusComments">
<div id="disqus_thread"></div>
<script>
var disqus_config = function () {
this.page.url = "[%thispageurl%]";
};
(function () {
var d = document, s = d.createElement ('script');
s.src = '//smallpict.disqus.com/embed.js';
s.setAttribute ('data-timestamp', +new Date());
@scripting
scripting / config.json
Last active June 25, 2016 19:12
Example of a config.json with a 404 page specified
{
"myPort": 1999,
"websocketPort": 2000,
"myDomain": "1999.bullmancuso.io:1999",
"where": {
"flUseLocalFilesystem": true,
"publicPath": "publicFiles/",
"privatePath": "privateFiles/"
},
"url404page": "http://1999.io/error.html",
@scripting
scripting / config.json
Created July 8, 2016 19:51
config.json file for my.1999.io (minus some special purpose stuff)
{
"myPort": 1999,
"websocketPort": 2000,
"myDomain": "my.1999.io",
"where": {
"flUseLocalFilesystem": true,
"publicPath": "publicFiles/",
"privatePath": "privateFiles/"
},
@scripting
scripting / config.json
Created July 8, 2016 19:59
config.json for my.1999.io with fewer redactions
{
"myPort": 1999,
"websocketPort": 2000,
"myDomain": "my.1999.io",
"flForceTwitterLogin": true,
"url404page": "http://1999.io/error.html",
"where": {
"flUseLocalFilesystem": true,
@scripting
scripting / example.js
Created July 12, 2016 14:24
Question about best practice with JS objects and internal method calls
messageOfTheDay = function (appName) {
this.appName = appName;
if (this.lastMessageText === undefined) {
this.lastMessageText = "";
}
this.sayHello = function () {
console.log ("hello");
}
this.checkForUpdate = function () {
var urlTextFile = "http://1999.io/testing/motd/" + this.appName + ".txt";