Skip to content

Instantly share code, notes, and snippets.

View apowers313's full-sized avatar

Adam Powers apowers313

View GitHub Profile
@apowers313
apowers313 / mds-collections.json
Created July 9, 2018 17:34
A collection of FIDO MDS data
This file has been truncated, but you can view the full file.
{
"mdsCollections": [
{
"fido-mds1": {
"toc": {
"nextUpdate": "2018-07-06",
"no": 63
},
"entries": {
"0013#0061": {
@apowers313
apowers313 / Makefile
Created November 9, 2020 03:54
Emscripten Memory Leak on node.js
CC=emcc
CFLAGS =
CFLAGS += -Wall
CFLAGS += -Werror
CFLAGS += -s MODULARIZE
CFLAGS += -s EXIT_RUNTIME
all:
emcc leak.c $(CFLAGS) -o build/test.js
@apowers313
apowers313 / test.ts
Created December 8, 2021 17:49
Deno Redis Compat
// setup:
// npm init -y
// npm install --save redisgraph.js
// run with:
// deno run --allow-all --unstable --compat test.ts
const RedisGraph = require("redisgraph.js").Graph;
let graph = new RedisGraph("social");
@apowers313
apowers313 / test.ts
Created December 8, 2021 17:52
Deno Redis TCP setNoDelay Issue
// run with:
// deno run --allow-all --unstable test.ts
import { Graph as RedisGraph } from "https://esm.sh/redisgraph.js";
let graph = new RedisGraph("social");
// fails with error:
/*
error: Uncaught Error: Not implemented
throw new Error(message);
@apowers313
apowers313 / output.txt
Last active December 12, 2021 09:32
ideno-rust initial zmq output
[I 01:30:17.834 NotebookApp] Kernel started: aefa459b-5c3e-4d6c-8791-7e42723d61cf, name: rusty
[D 01:30:17.834 NotebookApp] Kernel args: {'kernel_name': 'rusty', 'cwd': '/Users/ampower/Projects/personal/ideno-rust'}
[D 01:30:17.834 NotebookApp] Path toc2/toc2.js served from /Users/ampower/Library/Jupyter/nbextensions/toc2/toc2.js
[D 01:30:17.835 NotebookApp] 200 GET /nbextensions/toc2/toc2.js?v=20211212013005 (::1) 5.130000ms
[D 01:30:17.835 NotebookApp] Path collapsible_headings/main.css served from /Users/ampower/Library/Jupyter/nbextensions/collapsible_headings/main.css
[D 01:30:17.836 NotebookApp] 200 GET /nbextensions/collapsible_headings/main.css?v=20211212013005 (::1) 5.520000ms
[D 01:30:17.837 NotebookApp] Using contents: services/contents
[W 01:30:17.838 NotebookApp] 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20211212013005 (::1) 6.600000ms referer=http://localhost:8888/notebooks/Untitled15.ipynb?kernel_name=rusty
[D 01:30:17.840 NotebookApp] 201 POST /api/sessions (::1) 59.690000ms
[D
@apowers313
apowers313 / messages.rs
Created December 13, 2021 07:41
Jupyter Messages in Rust
// /* *****************
// * SHELL MESSAGES
// * *****************/
// Shell Request Message Types
// "execute_request" // https://jupyter-client.readthedocs.io/en/latest/messaging.html#execute
// "inspect_request" // https://jupyter-client.readthedocs.io/en/latest/messaging.html#introspection
// "complete_request" // https://jupyter-client.readthedocs.io/en/latest/messaging.html#completion
// "history_request" // https://jupyter-client.readthedocs.io/en/latest/messaging.html#history
@apowers313
apowers313 / main.rs
Last active December 21, 2021 19:34
Rust method as function pointer
use std::collections::HashMap;
macro_rules! handler {
($kernel:expr, $method:ident) => {
Box::new(|x| $kernel.$method(x))
};
}
fn main() {
let k = Kernel::new();
@apowers313
apowers313 / log.txt
Created December 28, 2021 16:48
IDeno hang bug (20211228)
88665a0e64ba:deno ampower$ jupyter notebook
[D 08:31:18.955 NotebookApp] Raising open file limit: soft 256->4096; hard 9223372036854775807->9223372036854775807
[D 08:31:18.979 NotebookApp] Paths used for configuration of jupyter_notebook_config:
/etc/jupyter/jupyter_notebook_config.json
[D 08:31:18.980 NotebookApp] Paths used for configuration of jupyter_notebook_config:
/usr/local/etc/jupyter/jupyter_notebook_config.json
[D 08:31:18.980 NotebookApp] Paths used for configuration of jupyter_notebook_config:
/usr/local/Cellar/jupyterlab/3.2.4/libexec/etc/jupyter/jupyter_notebook_config.d/jupyterlab.json
/usr/local/Cellar/jupyterlab/3.2.4/libexec/etc/jupyter/jupyter_notebook_config.json
[D 08:31:18.981 NotebookApp] Paths used for configuration of jupyter_notebook_config:
@apowers313
apowers313 / test.ts
Last active January 6, 2022 19:38
Deno logger levels
import * as log from "https://deno.land/[email protected]/log/mod.ts";
const l = log.getLogger("default");
l.level = log.LogLevels.DEBUG;
l.debug("Hello world"); // XXX: never printed!!!
l.info(123456);
l.warning(true);
l.error({ foo: "bar", fizz: "bazz" });
l.critical("500 Internal server error");
@apowers313
apowers313 / hello.yaml
Created April 17, 2023 04:38
Basic microk8s / Kubernetes service
apiVersion: v1
kind: Service
metadata:
name: ingress
namespace: ingress
spec:
selector:
name: nginx-ingress-microk8s
type: LoadBalancer
# loadBalancerIP is optional. MetalLB will automatically allocate an IP