Skip to content

Instantly share code, notes, and snippets.

View humorless's full-sized avatar

Laurence Chen humorless

View GitHub Profile
@daveliepmann
daveliepmann / assert-or-not.md
Last active March 2, 2025 12:24
A guide to orthodox use of assertions in Clojure.

When to use assert?

In JVM Clojure, Exceptions are for operating errors ("something went wrong") and Assertions are for programmer and correctness errors ("this program is wrong").

An assert might be the right tool if throwing an Exception isn't enough. Use them when the assertion failing means

  • there's a bug in this program (not a caller)
  • what happens next is undefined
@humorless
humorless / prompt-business.md
Last active December 23, 2024 02:47
Good Prompt

推斷 niche market

從網路上現存的資訊,分析 {公司官方網站} 這家公司。

{公司名稱} 是什麼細分市場的領導者?

推斷 value proposition

@humorless
humorless / java-time.api.md
Created August 17, 2024 07:27
java time library

Duration

(time/duration dur-str)

ZoneId type

(def event-time-zone (java.time.ZoneId/of "Europe/Brussels"))
;; Logging is a bit of a lost art. I see people use it the same way they use
;; println debugging, putting in lots of (log/debug "HERE") kind of stuff, and
;; then removing it afterwards.
;;
;; But with a good logging library these logging statements can continue to
;; provide value, even if (especially if) most of the time you turn them off.
;; For this you need to make good use of log levels like
;; error/warn/info/debug/trace. What follows is an illustrated example of how I
;; tend to use them.
@humorless
humorless / dbt-duckdb-tutorial.md
Last active May 18, 2024 15:43
Modern data stack by REPLWARE

Modern data stack

Main features

REPLWARE 建議的資料分析技術棧 (modern data stack) 主要有下列特色:

  • ELT over ETL
  • SQL based analytics over non-SQL based analytics
  • Analytic Engineer as a new position
  • When the data is not exceeding 1T, your desktop/notebook is fast enough.
@humorless
humorless / Clojure-tutorial.md
Last active November 5, 2022 09:42
Clojure 速成

為什麼要用 Clojure 語言來開發軟體?

在 Clojure 社群的一個說法:「同樣的工程師使用 Java 來開發軟體、使用 Nodejs 來開發軟體、使用 Clojure 來開發同樣軟體所花費的時間,大約是:5:3:1。」

Part 1: Basic

lesson 1: syntax

  1. truth, math, string
  2. Intros to list, vector, map, set
  3. conj: conj list ,conj vector ,conj map ,conj set
@humorless
humorless / emacs.md
Last active October 14, 2021 06:35
project quality control

invoke function

SPC SPC = M-x
- load-theme
- add-project
- global-linum-mode

special commands

@humorless
humorless / core.clj
Created September 15, 2021 03:19 — forked from plexus/core.clj
(ns my-backend.core
(:gen-class)
(:require [compojure.core :as c]
[compojure.route :as route]
[ring.adapter.jetty :as jetty]
[ring.middleware.defaults :as ring-defaults]
[hiccup2.core :as h]
#_[muuntaja.core :as m]
[muuntaja.middleware :as muuntaja]))
(ns my-backend.core
(:gen-class)
(:require [compojure.core :as c]
[compojure.route :as route]
[ring.adapter.jetty :as jetty]
[ring.middleware.defaults :as ring-defaults]
[hiccup2.core :as h]
#_[muuntaja.core :as m]
[muuntaja.middleware :as muuntaja]))
@humorless
humorless / gh-pages.md
Created May 27, 2020 07:23
How to create github project pages
  1. Create gh-pages branch
git checkout --orphan gh-pages
git rm -rf .    # 砍掉所有檔案重來
...  # 加新檔案
git add .
git commit -m 'create new branch'

Push this branch to github repo