Skip to content

Instantly share code, notes, and snippets.

View game-of-chairs.clj
(ns day-eleven
(:require
[ysera.test :refer [is is-not is= deftest]]
[ysera.debug :refer [printreturn printlet]]))
(defn get-seat
{:test (fn []
(is= (get-seat [".#"
"L."] [1 0]) "#")
(is= (get-seat [".#"
View swap.ts
swap(swapFunction: (state: T, ...rest: any[]): T, ...args: any[]): T {
this.state = swapFunction.apply(null, [this.state, ...args]);
return this.state;
}
View onChange.ts
onChange(listener: (state: T) => void) {
autorun(() => listener(this.state));
}
View reskassa-scraper.py
from datetime import timedelta, date
import subprocess
import json
import pandas
def run(command, current_date, end_date):
transactions = []
fifteen_days = timedelta(days=15)
@agentbellnorm
agentbellnorm / business_hours_in_range.py
Last active Jul 30, 2018
Calculate business hours between two datetime instances. Non office hours and configured holidays are excluded.
View business_hours_in_range.py
from datetime import datetime, timedelta
import numpy
def hour_diff(a, b):
delta = a - b
day_hours = delta.days * 24
second_hours = delta.seconds / 3600
return day_hours + second_hours
View onename
Verifying that +morganbentell is my blockchain ID. https://onename.com/morganbentell