I hereby claim:
- I am mariotacke on github.
- I am mariotacke (https://keybase.io/mariotacke) on keybase.
- I have a public key whose fingerprint is 1F76 387C 0FA4 7B32 B93E 8211 24A9 1971 A631 92F4
To claim this, I am signing this object:
root = true | |
[*] | |
indent_style = space | |
indent_size = 2 | |
end_of_line = lf | |
charset = utf-8 | |
trim_trailing_whitespace = true | |
insert_final_newline = true |
I hereby claim:
To claim this, I am signing this object:
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |
{ | |
"env": { | |
"node": true, | |
"es6": true | |
}, | |
"extends": [ | |
"eslint:recommended" | |
], | |
"parserOptions": { | |
"sourceType": "module", |
# https://www.rabbitmq.com/passwords.html#computing-password-hash | |
PASSWORD=$(openssl rand -base64 20) | |
SALT=$(openssl rand -hex 4) | |
HASH=$(echo -n "$SALT"$(echo -n "$PASSWORD" | xxd -u -p) | xxd -r -p | sha256sum | head -c 64) | |
PASSWORD_HASH=$(echo -n $SALT$HASH | xxd -r -p | base64) | |
echo $PASSWORD | |
echo $PASSWORD_HASH |
const express = require('express'); | |
const path = require('path'); | |
const fs = require('fs'); | |
const indexHtml = fs.readFileSync(path.join(__dirname, 'public', 'index.html'), 'utf8'); | |
const app = express(); | |
app.get('/', function (req, res) { | |
const html = indexHtml.replace(/\$CHANNEL_NAME/, process.env.CHANNEL_NAME); |
const tmi = require('tmi.js'); | |
const redis = require('redis'); | |
const bluebird = require('bluebird'); | |
bluebird.promisifyAll(redis); | |
const options = { | |
identity: { | |
username: process.env.BOT_USERNAME, | |
password: process.env.OAUTH_TOKEN, |
app.get('/api/channel/:channel/words', async function (req, res) { | |
const channel = `#${req.params.channel}`; | |
const args = [channel, '0', '50', 'WITHSCORES']; | |
const scores = []; | |
const range = await redisClient.zrevrangeAsync(args); | |
for (let i = 0; i < range.length; i += 2) { | |
scores.push({ | |
key: range[i], |
async function getCloud () { | |
const response = await fetch('/api/channel/$CHANNEL_NAME/words'); | |
const json = await response.json(); | |
const cloud = json.scores.map(function ({ key, value }) { | |
return { text: key, size: value }; | |
}); | |
return cloud; | |
} |
async function init () { | |
const cloud = await getCloud(); | |
const highestScore = Math.max(...cloud.map((x) => x.size)); | |
var layout = d3.layout.cloud() | |
.size([500, 500]) | |
.words(cloud) | |
.rotate(function () { return ~~(Math.random() * 2) * 90; }) | |
.font("Impact") |