Skip to content

Instantly share code, notes, and snippets.

@coolov
coolov / stripe-subs.sh
Created October 14, 2025 00:04
stripe subscriber data
#!/bin/sh
# bash script for exporting subscriber data from stripe, using the stripe cli:
# https://docs.stripe.com/stripe-cli
# make sure you sign in first:
# https://docs.stripe.com/stripe-cli/install#login-account
echo "id,name,shipping.name,shipping.address.city,shipping.address.country,shipping.address.line1,shipping.address.line2,shipping.address.postal_code,shipping.address.state,subscriptions.count,subscriptions.status,subscriptions.plan.product"
STARTING_AFTER=""
@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);
```