Skip to content

Instantly share code, notes, and snippets.

View nmcclain's full-sized avatar

Ned McClain nmcclain

View GitHub Profile
@nmcclain
nmcclain / notion-browser-content.js
Created April 24, 2021 16:46
notion-browser-content.js
for (var id of window.__console.AppStore.instanceState.currentBlockStore.instanceState.value.content) {
for (var entry of Array.from(window.__console.AppStore.instanceState.currentBlockStore.inMemoryRecordCache.cache)) {
if (entry[0].startsWith(id)) {
console.log(entry[1].value.value);
}
}
}
@nmcclain
nmcclain / gettoken.js
Last active June 22, 2021 22:31
Get Notion.so token_v2 with username/password
// DANGER: Run this too frequently and you can lock out your Notion account.
// Once a day should be sufficient for most use cases.
//
// npm i -D playwright
// export NOTION_TOKEN=`node gettoken/gettoken.js`
const { chromium } = require('playwright');
const user = 'XXXX';
const pass = 'YYYY';
@nmcclain
nmcclain / supervisely_dtl_example.json
Last active October 10, 2022 21:53
Example DTL for image augmentation with Supervise.ly
[
{
"dst": "$raw",
"src": [
"roads_annotated/*"
],
"action": "data",
"settings": {
"classes_mapping": "default"
}
@nmcclain
nmcclain / keybase.md
Last active August 4, 2017 19:45
Keybase proof

Keybase proof

I hereby claim:

  • I am nmcclain on github.
  • I am ned (https://keybase.io/ned) on keybase.
  • I have a public key whose fingerprint is 1F9A B33F 20C3 DDBA 08D1 0E6C FA80 6473 5FF0 0CD9

To claim this, I am signing this object:

@nmcclain
nmcclain / flapjack-Dockerfile
Last active January 4, 2016 07:49
Dockerfile for flapjack. 1. save as "Dockerfile" 2. run "docker build" 3. run "docker run -i -d -p 3080:3080 IMAGEID" 4. profit
FROM ubuntu:12.04
RUN apt-get install -y software-properties-common
RUN echo "deb http://packages.flapjack.io/deb precise main" >> /etc/apt/sources.list
RUN apt-get update
RUN apt-get install -y --force-yes flapjack
RUN apt-get install -y wget curl vim git
# customized flapjack config files
ADD assets/flapjack_config.yaml /etc/flapjack/flapjack_config.yaml
ADD assets/redis-flapjack.conf /opt/flapjack/embedded/etc/redis/redis-flapjack.conf
@nmcclain
nmcclain / aws_route53_IAM_ddns_permissions
Created January 19, 2014 19:35
Minimal R53 permissions needed to support DDNS updates, ala: https://gist.github.com/nmcclain/8509874
{
"Statement":[
{
"Action":[
"route53:ChangeResourceRecordSets",
"route53:GetHostedZone",
"route53:ListResourceRecordSets"
],
"Effect":"Allow",
"Resource":[
@nmcclain
nmcclain / update_aws_route53_ddns
Last active January 3, 2016 19:39
Crude script to update an AWS Route53 entry from cron
#!/usr/bin/php
<?php
# crude script to update an AWS Route53 entry from cron
$hostname = "homer";
$domain = "simpsons.org";
$ip = chop(`curl -s http://www.telize.com/ip`);
$r53ip = chop(`cli53 rrlist $domain | grep $hostname | awk '{print $5}'`);
#!/usr/bin/python
import socket
import sys
from optparse import OptionParser
EXIT_OK = 0
EXIT_WARN = 1
EXIT_CRITICAL = 2
# Twilio HTTP HAProxy Configuration
# Version: 0.1
global
daemon
log 127.0.0.1 local0 info
maxconn 60000
spread-checks 3
{
"status":"OK",
"EstNumber":"M278",
"actions":[
{"action":"Food Safety Hazard", "quarter":"Q1 2012"},
{"action":"Unsanitary Conditions", "quarter":"Q1 2012"}
]
}