Skip to content

Instantly share code, notes, and snippets.

@jwickens
jwickens / database.py
Last active March 28, 2022 11:33
Pytorch-like iterable Dataset example backed by async iterator (postgres)
import asyncpg
async def create_pool():
pool = await asyncpg.create_pool(
database="research",
user="jwickens",
setup=setup_connection,
min_size=32,
max_size=32
)
@jwickens
jwickens / index.js
Last active January 4, 2018 20:28
ngrok wrapper es6
const request = require('request-promise-native')
const { spawn } = require('child_process')
const { EventEmitter } = require('events')
const platform = require('os').platform()
const uuid = require('uuid')
// const url = require('url')
const path = require('path')
const bin = './ngrok' + (platform === 'win32' ? '.exe' : '')
@jwickens
jwickens / index.html
Created March 18, 2017 16:56
Vue.js + D3 Force
<!DOCTYPE html>
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/react/0.11.0/react.min.js"></script>
<script src="https://unpkg.com/vue/dist/vue.js"></script>
</head>
<body>
<div id="container">
<svg v-bind:width="width" v-bind:height="height">