Skip to content

Instantly share code, notes, and snippets.

View ReedD's full-sized avatar
🎯
Focusing

Reed Dadoune ReedD

🎯
Focusing
View GitHub Profile
@ReedD
ReedD / docker_to_host.sh
Created February 8, 2017 23:41
Let docker connect to host, output host ip.
#!/bin/bash
iptables -A INPUT -i docker0 -j ACCEPT
# Assumes host has `jq` installed
docker network inspect bridge | jq -r .[0].IPAM.Config[0].Gateway
@ReedD
ReedD / dragScrollEnd.ts
Created May 26, 2017 04:23
Observable for drag-scroll-end.
import * as Rx from 'rxjs'
const pointerDown$ = Rx.Observable.race(
Rx.Observable.fromEvent(window, 'mousedown'),
Rx.Observable.fromEvent(window, 'touchstart'),
)
const drag$ = pointerDown$.flatMap(() => {
const pointerUp$ = Rx.Observable.race(
Rx.Observable.fromEvent(window, 'mouseup'),
@ReedD
ReedD / alliantSum.js
Last active September 4, 2018 04:09
Sum all transactions since the last statement date.
function sumTransactions(lastStatementDateString) {
const lastStatementDate = new Date(lastStatementDateString);
return [
'ctl00_ctl00_pagePlaceholder_sectionContent_ucTrans_gvPTV',
'ctl00_ctl00_pagePlaceholder_sectionContent_ucPending_gvPending',
]
.map(id =>
Array.from(document.querySelectorAll(`#${id} tr`))
.map(row => {
const columns = Array.from(row.querySelectorAll('td')).map(