Skip to content

Instantly share code, notes, and snippets.

View JohnMcLear's full-sized avatar
🌴
On vacation

John McLear JohnMcLear

🌴
On vacation
View GitHub Profile
'use strict';
/**
* This code is mostly from the old Etherpad. Please help us to comment this code.
* This helps other people to understand this code better and helps them to improve it.
* TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED
*/
/**
* Copyright 2009 Google Inc.
*
C:\new-etherpad-lite-win>node src\node\server.js
[2021-02-17 21:30:31.017] [DEBUG] console - Running on Node v12.20.2 (minimum required Node version: 10.17.0)
[2021-02-17 21:30:31.044] [INFO] console - All relative paths will be interpreted relative to the identified Etherpad base dir: C:\new-etherpad-lite-win
[2021-02-17 21:30:31.045] [INFO] console - Random string used for versioning assets: ecf0e541
[2021-02-17 21:30:31.046] [DEBUG] AbsolutePaths - Relative path "settings.json" can be rewritten to "C:\new-etherpad-lite-win\settings.json"
[2021-02-17 21:30:31.046] [DEBUG] AbsolutePaths - Relative path "credentials.json" can be rewritten to "C:\new-etherpad-lite-win\credentials.json"
[2021-02-17 21:30:31.055] [INFO] console - settings loaded from: C:\new-etherpad-lite-win\settings.json
[2021-02-17 21:30:31.059] [INFO] console - No credentials file found in C:\new-etherpad-lite-win\credentials.json. Ignoring.
[2021-02-17 21:30:31.061] [INFO] console - Using skin "colibris" in dir: C:\new-etherpad-lite-win\src
@JohnMcLear
JohnMcLear / gist:b6d6430cd20a0fee4e6261734d67c51e
Created February 16, 2021 17:43
promisify haproxy npm module
'use strict';
const HAProxy = require('haproxy');
const haproxy = new HAProxy('/tmp/haproxy.sock');
const ha = (method) => {
return new Promise((resolve, reject) => {
haproxy[method]((err, data) => {
if (err) {
return reject(err);
@JohnMcLear
JohnMcLear / lint.md
Created November 22, 2020 16:51
Lint instructions

I'm looking for someone to help fix the linting issues on Etherpad plugins that the npm run lint:fix can't fix automatically.

Why you should do this?

This will be good experience for a junior web dev, it will teach the following skills:

  • git & Github (fork, branch, commit, push, pull requests)
  • linting
  • Javascript code editing
  • Nodejs app execution
  • Etherpad file structure
HTTP/1.1 200 OK
Server: nginx/1.10.3
Date: Sun, 15 Nov 2020 16:05:32 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 42015
Connection: keep-alive
X-Powered-By: Express
X-UA-Compatible: IE=Edge,chrome=1
Referrer-Policy: same-origin
ETag: W/"a41f-CEbzxqIqlIZdJwLcwq38rO7l/Xs"
root@loadtest:/home/pi/etherpad-lite# curl -I http://loadtest/p/one
HTTP/1.1 200 OK
Server: nginx/1.10.3
Date: Sun, 15 Nov 2020 16:03:28 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 42015
Connection: keep-alive
X-Powered-By: Express
X-UA-Compatible: IE=Edge,chrome=1
server {
listen 80;
server_name _;
add_header X-ref $http_referer; #is populated for css but not js
add_header X-hello "world"; #works
location / {
proxy_pass http://127.0.0.1:9001;
}
}
/**
* 2011 Peter 'Pita' Martischka
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
/**
* 2011 Peter 'Pita' Martischka
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@JohnMcLear
JohnMcLear / dirty.db
Created March 31, 2020 10:35
Access padId "faw" you will see some errors in client and server. Error replicated by playing with 2802
{"key":"pad2readonly:faw","val":"r.7b81013d611a1254ccda58a5667cb721"}
{"key":"readonly2pad:r.7b81013d611a1254ccda58a5667cb721","val":"faw"}
{"key":"pad:faw:revs:0","val":{"changeset":"Z:1>bi|7+bi$Welcome to Etherpad!\n\nThis pad text is synchronized as you type, so that everyone viewing this page sees the same text. This allows you to collaborate seamlessly on documents!\n\nGet involved with Etherpad at http://etherpad.org\n\nWarning: DirtyDB is used. This is fine for testing but not recommended for production. -- To suppress these warning messages change suppressErrorsInPadText to true in your settings.json\n","meta":{"author":"","timestamp":1585587939652,"atext":{"text":"Welcome to Etherpad!\n\nThis pad text is synchronized as you type, so that everyone viewing this page sees the same text. This allows you to collaborate seamlessly on documents!\n\nGet involved with Etherpad at http://etherpad.org\n\nWarning: DirtyDB is used. This is fine for testing but not recommended for production. -- To suppress these