Skip to content

Instantly share code, notes, and snippets.

View gojomo's full-sized avatar

Gordon Mohr gojomo

View GitHub Profile
@gojomo
gojomo / notion-custom-domain.js
Created October 5, 2019 00:31 — forked from mayneyao/notion2blog.js
notion.so custom domain
const MY_DOMAIN = "your domain"
const START_PAGE = "start page url"
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET, HEAD, POST,PUT, OPTIONS",
@gojomo
gojomo / mq-in-shell.txt
Created October 6, 2015 17:13
Count female/male pronouns in a plain-text file (here, Moby Dick from Project Gutenberg)
$ curl http://www.gutenberg.org/cache/epub/2701/pg2701.txt > moby-dick.txt
$ tr -cs "[:alpha:]" "\n" < moby-dick.txt | egrep "^(she|her|hers|herself)$" | wc -l
439
$ tr -cs "[:alpha:]" "\n" < moby-dick.txt | egrep "^(he|him|his|himself)$" | wc -l
5384
@gojomo
gojomo / lspid.sh
Created June 18, 2015 07:57
lspid.sh: given pid, list open files & seek offsets (effectively watch progress, if util scans large file front to back)
#!/bin/bash
TARGET_PID=$1
shift
cd /proc/$TARGET_PID/fd/
if [ -n "$1" ]
then
TARGET_FDS=$@
else
TARGET_FDS=*
<head>
<style>
table.container {
width: 522px;
border-spacing: 0;
border:1px solid gray;
}
.container td {
text-align: center;