Skip to content

Instantly share code, notes, and snippets.

aidanhmiles /
Last active Nov 8, 2020
This Python script demonstrates how to run analyses on user-submitted data files using Panel. It runs a Holoviz Panel webpage with a single Plotly line chart which is fed by a FileInput that accepts only CSVs.
# python 3.7+
# install dependencies:
# pip install panel pandas plotly
# run it: panel serve --show
import io
import param
import panel as pn
import pandas as pd
import as px
aidanhmiles / promise-retry-1.js
Created May 11, 2017
One way to retry promises
View promise-retry-1.js
const lodash = require('lodash');
function main () {
// Arbitrary async operation. Sums two coin-flips (random 0 or 1). Only resolves when the sum is 0.
function asyncOperation() {
return new Promise((resolve, reject) => {
let sum = lodash(new Array(2))
.map(() => Math.round(Math.random()))
aidanhmiles /
Created Jan 31, 2017
Copy files from A to B, preserving directory hierarchy from wherever the script is executed
#!/usr/bin/env bash
main() {
local files=()
# Method 1
# while read -r fname; do
# derp+=("$fname")
# done < <(ag -g html base/)

Keybase proof

I hereby claim:

  • I am aidanhmiles on github.
  • I am aidanhmiles ( on keybase.
  • I have a public key ASCIzh8EBfOMVfl1XSEFphNxSNO2jvfLg1NdvAhlvokWqQo

To claim this, I am signing this object: