Skip to content

Instantly share code, notes, and snippets.

@coolov
coolov / http-cache-node.ts
Created June 15, 2021 21:42
http-cache-node.ts
import Database, { Statement, Options } from "better-sqlite3";
import { Request, Response } from "node-fetch";
interface Record {
url: string;
status: number;
statusText: string;
body: Buffer;
headers: string;
insertTime: number;
@coolov
coolov / vax-checker.js
Last active April 6, 2021 17:23
checks for appointments on the vax4nyc.nyc.gov "schedule an appointment screen"
// based on this awesome script
// https://gist.github.com/saranrapjs/f8700e33332ae4a13a931e761fc262a7
(function check() {
// they have hijacked document.querySelector/getElementById/etc but not document.all
Array.from(document.all).filter(el => el.nodeName.toLowerCase() === 'lightning-button-icon')[0].click();
setTimeout(() => {
Array.from(document.all).filter(el => el.name === 'today')[0].click();
setTimeout(() => {
const txt = Array.from(document.all).filter(el => el.className === 'appointment-section')[0].textContent;
@coolov
coolov / build.jsonnet
Created October 13, 2020 19:25
depends_on utility
local util = import 'util.jsonnet';
local test = import 'test.jsonnet';
local build_css = {
image: 'node-image',
name: 'build-css',
depends_on: util.depends_on([test.lint_css, test.lint_script, test.test_js]),
commands: [] // etc
};
@coolov
coolov / svg-fonts.js
Last active February 21, 2022 21:07
A script for inlining fonts into SVG documents. There is a better version of this script here: https://github.com/coolov/svgum
/*
!!!!!
USE THIS TOOL INSTEAD:
https://github.com/coolov/svgum
!!!!
If you use https://app.diagrams.net/ with google webfonts and export to svg and then
#!/bin/bash
# Liquid Soap Install Script
# https://www.liquidsoap.info/
brew update
brew install opam
# based on
# https://github.com/savonet/liquidsoap/blob/master/doc/content/install.md#install-using-opam
@coolov
coolov / fun-func-function.md
Last active July 1, 2021 14:48
kotlin swift typescript

fun func function

// kotlin

fun greetUser(name: String = "World"): String {
  return "Hello ${name}!"
}

fun main(args: Array<String>) {

tokens

there are 5 types: identifier, keyword, punctuation, literal, or operator

  • A keyword is a word that is reserved because the word has a special meaning, for example: class, enum, function.
  • An identifier is a symbol which names a language entitiy, for example a variable, type, label, subroutine, or package
  • Punctuation (, ), {, }, [, ], ., ,, :, ;, =, @, #, &
  • A literal is the source code representation of a value of a type, such as a number or string
  • An operator is a symbol that tell the compiler to perform specific mathematical or logical manipulations
@coolov
coolov / server.js
Last active February 24, 2020 19:22
mnml node server
const fs = require("fs");
const util = require("util");
const http = require("http");
const path = require("path");
const stat = util.promisify(fs.stat);
const port = 8080;
const rootDir = path.join(__dirname, "public");
const mimeTypes = {
@coolov
coolov / fetch.js
Last active September 18, 2019 23:27
/*
mnmlst fetch implementation for node
list of options:
https://nodejs.org/api/http.html#http_http_request_url_options_callback
example:
```
let { body } = await get('https://dog.ceo/api/breeds/image/random');
let data = JSON.parse(body);
```
@coolov
coolov / alan-licht.md
Last active April 10, 2018 22:24
Lists

Alan Licht's minimal top ten

  1. Charlemagne Palestine - Four Manifestations on Six Elements (Castelli-Sonnabend, 1974) YouTube
  2. Terry Riley - Reed Streams (Mass Arts, 1966) YouTube Spotify
  3. La Monte Young - The Black Record (Edition X, West Germany, 1969); Bootleg (Italy, 1992) YouTube
  4. Steve Reich - Four Organs (Shandar, 1971) YouTube Spotify
  5. Phill Niblock - Nothin' to Look at, Just a Record (India Navigation, 1979)
  6. Henry Flynt - You Are My Everlovin' (self-released cassette, 1987) YouTube
  7. Tony Conrad - Outside the Dream Syndicate (Caroline, 1974) YouTube
  8. Jon Gibson - Tw