Skip to content

Instantly share code, notes, and snippets.

View Sasquire's full-sized avatar
💭
Alive

Sasquire

💭
Alive
View GitHub Profile
@Sasquire
Sasquire / e621_elo_compare.user.js
Last active July 10, 2019 04:20
A quick something to compare posts with an elo rating to try and find what your favorite is.
// ==UserScript==
// @name e621 elo compare
// @namespace http://tampermonkey.net/
// @version 1.00001
// @description try to take over the world!
// @author Sasquire
// @match https://e621.net/extensions/post_elo
// @match http://e621.net/extensions/post_elo
@Sasquire
Sasquire / markov_maker.js
Last active February 15, 2019 06:25
Takes a file with a list of sentences that are separated by newlines where words are space delimited. This assumes the file only has characters ` A-z0-9 ` and ` <>~#$%^&()-_=+/ ` and ` ' " `
const fs = require('fs');
const all_lines = fs.readFileSync('./forums_but_nice.txt', 'utf8')
.slice(0, -1)
.split('\n')
.map(e => e.split(' ').map(p => p.toLowerCase()));
const all_words = {};
all_lines.forEach(line => line.forEach(word =>
all_words[word] ? all_words[word]++ : all_words[word] = 1
));