Skip to content

Instantly share code, notes, and snippets.

View ccarcaci's full-sized avatar

ccarcaci ccarcaci

View GitHub Profile
@ccarcaci
ccarcaci / SPEC.md
Last active August 14, 2026 13:54
old_typewriter_gist

The Typewriter Formatting Specification

Version 0.0.2

This is a formal description of the plain-text formatting conventions of the mechanical typewriter, derived from the CommonMark Markdown specification. This revision targets a machine without overstriking.

The purpose of this specification is to provide some guidelines on how to write documents immediately readable from terminals with very limited rendering capabilities and also printable.

Reading documents written in other formats requires renders or degrading the reading experience to mentally skip the formatting syntax.

@ccarcaci
ccarcaci / gist:015dc56708e435d3f6e984e07cfffe23
Created October 13, 2021 14:54
Most profit from stock quotes (Joke)
// https://imgflip.com/i/5q9vei
let called = 0
function getMostProfitFromStockQuotes(quotes) {
called++
if(called === 1) { return 15 }
if(called === 2) { return 0 }
if(called === 3) { return 18 }
if(called === 4) { return 26 }
}
May 07 11:57:05.088 INFO vector::app: Log level is enabled. level="vector=info,codec=info,vrl=info,file_source=info,tower_limit=trace,rdkafka=info"
May 07 11:57:05.088 INFO vector::sources::host_metrics: PROCFS_ROOT is unset. Using default '/proc' for procfs root.
May 07 11:57:05.088 INFO vector::sources::host_metrics: SYSFS_ROOT is unset. Using default '/sys' for sysfs root.
May 07 11:57:05.088 INFO vector::app: Loading configs. path=[("/etc/vector/vector.toml", Some(Toml))]
May 07 11:57:05.100 INFO vector::topology: Running healthchecks.
May 07 11:57:05.103 INFO vector::topology: Starting source. name="dummy_log_files"
May 07 11:57:05.103 INFO vector::topology: Starting sink. name="to_kafka"
May 07 11:57:05.104 INFO source{component_kind="source" component_name=dummy_log_files component_type=file}: vector::sources::file: Starting file server. include=["/var/log/**/*.log"] exclude=[]
May 07 11:57:05.105 INFO vector: Vector has started. version="0.13.1" git_version="v0.13.1" released="Thu, 29 Apr 202
@ccarcaci
ccarcaci / pipe.js
Created May 3, 2020 20:12
Some Useful Functions
"use strict"
module.exports = (startingParams, ...steps) => {
return steps.reduce((accumulator, currentStep) => {
if(accumulator === undefined) { return undefined }
return currentStep(accumulator)
}, startingParams)
}
@ccarcaci
ccarcaci / mining-duty.js
Created January 4, 2020 17:19
Mining Duty
// Mining
setInterval(() => pipe(store.load(), (theChain) => store.save(theChain))(chain.mine), configs.miningInterval)
@ccarcaci
ccarcaci / mine.js
Created January 4, 2020 17:14
Mining
mine: (theChain) => {
let currentChain = duplicate(theChain)
const currentPage = currentChain
.slice(-1)
.pop()
if(currentPage.pageContent.transactions.length <= 0) { return }
currentPage.pageContent.padding = crypto.uuidv4()
currentPage.pageHash = crypto.sha3(currentPage.pageContent)
@ccarcaci
ccarcaci / index.js
Created October 8, 2019 14:17
poc-node-http-server index
"use strict"
const http = require("http")
const https = require("https")
const url = require("url")
const fs = require("fs")
const characters = require("./mocks/star-wars.json")
const httpsOptions = {
key: fs.readFileSync("./certs/privkey.pem"),
"lint-staged": {
"*.{js,jsx}": [
"npm run linter",
"npm t",
"git add ."
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
"devDependencies": {
"eslint": "^6.5.0",
}
@ccarcaci
ccarcaci / .env
Created October 7, 2019 10:09
no-process-env rule bypass
EENIE=meenie