Env iterm2 macosx
- Open the iTerm2 menu
- Select Preferences
- On the "General" tab, select "Selection."
- Check "Applications in the terminal may access the clipboard."
need to run
def f(activities): | |
import math | |
from datetime import datetime | |
act_by_date = dict() | |
for act in activities: | |
if act.get('type') != "Run": | |
continue | |
km = round(act["distance"]/1000, 2) |
def f(activities, team): | |
import math | |
from datetime import datetime | |
act_by_date = dict() | |
for act in activities: | |
dt_str = act.get('start_date_local') # 2021-02-12T20:40:00Z | |
dt_obj = datetime.strptime(dt_str, '%Y-%m-%dT%H:%M:%SZ') | |
# key for ac_by_date dict | |
dt_ymd = int("{}{}{}".format(dt_obj.year, dt_obj.month, dt_obj.day)) |
-- Link to youtube https://youtu.be/c4saFSUAmlg | |
-- | Remove all duplicate integers from a list. Produce a log as you go. | |
-- If there is an element above 100, then abort the entire computation and produce no result. | |
-- However, always keep a log. If you abort the computation, produce a log with the value, | |
-- "aborting > 100: " followed by the value that caused it. | |
-- If you see an even number, produce a log message, "even number: " followed by the even number. | |
-- Other numbers produce no log message. | |
-- | |
-- /Tip:/ Use `filtering` and `StateT` over (`OptionalT` over `Logger` with a @Data.Set#Set@). |
#!/bin/bash | |
set -e | |
# | |
# usage: | |
# cat athelete.txt | xargs -I$ sh -c './ecert-sketch.sh "$"' | |
# | |
slugify () { |
#!/bin/bash | |
set -e | |
slugify () { | |
echo "$1" | iconv -c -t ascii//TRANSLIT | sed -E 's/[~^]+//g' | sed -E 's/[^a-zA-Z0-9]+/-/g' | sed -E 's/^-+|-+$//g' | tr A-Z a-z | |
} | |
NAME=$1 | |
DISTANCE=$2 | |
LOOPS=$3 |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE NoImplicitPrelude #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE TypeApplications #-} | |
{-# LANGUAGE TypeFamilies #-} | |
module VestingSpecificRecipient | |
( vestingSpecificRecipient | |
, LockParams(..) | |
, VestingSchema |
Env iterm2 macosx
need to run
def calculate_set3(rs, acts): | |
if len(acts) == 0: | |
return rs | |
brick = [acts[0]] | |
for i in range(len(acts)): | |
if i == 0: | |
continue |
import Database.PostgreSQL.Simple | |
import System.Environment | |
import Database.PostgreSQL.Simple.Options | |
getDBConn :: IO Connection | |
getDBConn = do | |
-- get db info | |
hostName <- getEnv "DB_HOST" | |
dbName <- getEnv "DB_NAME" | |
userName <- getEnv "DB_USER" |