Moved to https://github.com/kbilsted/Functional-core-imperative-shell/blob/master/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns app.logging | |
(:refer-clojure :exclude [time]) | |
(:require #?(:clj [clojure.tools.logging :as log] | |
:cljs [goog.log :as glog])) | |
#?(:cljs (:import goog.debug.Console))) | |
#?(:cljs | |
(def logger | |
(glog/getLogger "app"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useContext, useState } from "react"; | |
import { BrowserRouter, Link } from "react-router-dom"; | |
import { Route, Switch } from "react-router"; | |
import { format, formatDistance, formatRelative } from "date-fns"; | |
import nb from "date-fns/locale/nb"; | |
import enUS from "date-fns/locale/en-US"; | |
type AppLocale = "en" | "nb"; | |
interface ApplicationTexts extends Record<AppLocale, string> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns defwrapper | |
(:require [clojure.string :as str])) | |
(set! *warn-on-reflection* true) | |
(defn class-methods [^Class class] | |
(seq (.getMethods class))) | |
(defn constructors [^Class klazz] | |
(.getDeclaredConstructors klazz)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PUBLIC_IP4_IFACE=eth2 | |
LISTEN_IFACE=${PUBLIC_IP4_IFACE} | |
listen_address=$(ip -f inet addr show dev ${LISTEN_IFACE} | grep -Po 'inet \K[\d.]+') | |
listen_port=${1} | |
target_host=${2} | |
target_port=${3} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; # EMULATING DATOMIC EXCISION VIA MANUAL DATA MIGRATION | |
;; ************************************* | |
;; ## Introduction | |
;; ************************************* | |
;; This Gist demonstrates a generic way to migrate an entire Datomic database | |
;; from an existing 'Origin Connection' to a clean 'Destination Connection', | |
;; while getting rid of some undesirable data and otherwise preserving history. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*.clj diff=clojure | |
*.cljs diff=clojure | |
*.cljx diff=clojure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn invoke-private-method [obj fn-name-string & args] | |
(let [m (first (filter (fn [x] (.. x getName (equals fn-name-string))) | |
(.. obj getClass getDeclaredMethods)))] | |
(. m (setAccessible true)) | |
(. m (invoke obj args)))) | |
(defn private-field [obj fn-name-string] | |
(let [m (.. obj getClass (getDeclaredField fn-name-string))] | |
(. m (setAccessible true)) | |
(. m (get obj)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import os | |
import boto3 | |
class S3MultipartUpload(object): | |
# AWS throws EntityTooSmall error for parts smaller than 5 MB | |
PART_MINIMUM = int(5e6) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns app.application | |
(:require | |
[com.fulcrologic.fulcro.application :as app] | |
[edn-query-language.core :as eql] | |
[com.fulcrologic.fulcro.algorithms.tx-processing :as txn] | |
[promesa.core :as p] | |
[com.wsscode.pathom3.interface.eql :as p.eql] | |
[com.wsscode.pathom3.connect.operation :as pco] | |
[com.wsscode.pathom3.connect.indexes :as pci])) |
OlderNewer