Skip to content

Instantly share code, notes, and snippets.

View humorless's full-sized avatar

Laurence Chen humorless

View GitHub Profile
@humorless
humorless / emacs.md
Last active February 4, 2024 03:50
corgi 筆記
@humorless
humorless / practice.cql
Created August 30, 2023 10:46
My practice of Cypher
Find People Born in the Fifties
Using the sandbox on the right, write and execute a query to return people born in the 1950’s (1950 - 1959) that are both Actors and Directors.
How many Person nodes are returned?
```
MATCH(p:Actor)
WHERE p:Director AND date('1950-01-01') <= date(p.born) < date('1959-12-31')
RETURN count(p)
```
@humorless
humorless / postwalk-example.clj
Created August 29, 2023 17:02
Example to show postwalk
(ns myproject
"FIXME: my new org.corfield.new/scratch project."
(:require [clojure.walk :as walk]))
(def tree
(list #:cil{:id 2
:children
(list #:citl{:id 2 :ip 2
:children
(list #:citl{:id 5 :tp 2}
@humorless
humorless / result.clj
Created August 28, 2023 10:19
Demo of treewalk - prewalk
[:customer-invoice
[:div.bg-violet-100.m-2.p-2.flex
[:p.flex-auto "Reference-number: invoice 1"]
[:p.flex-auto "status: unreleased"]]
[:customer-invoice-line
[:div.bg-violet-100.m-2.p-2.flex
[:p.flex-auto "Id: 1"]
[:p.flex-auto "Invoice: invoice 1"]
[:p.flex-auto "Amount: 2000"]]
[:customer-invoice-tax-line
@humorless
humorless / tax-lines-to-hiccup.clj
Last active August 28, 2023 09:45
Demo of treewalk
(ns myproject
"FIXME: my new org.corfield.new/scratch project."
(:require [clojure.walk :as walk]))
(def lines
(list {:reference-number "invoice 1"
:status "unreleased"}
(list {:invoice "invoice 1"
:account "100"
:desp "customer invoice line"
@humorless
humorless / dbt-duckdb-tutorial.md
Last active August 25, 2023 12:24
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 / clojars.md
Created November 10, 2022 08:34 — forked from hiteshjasani/clojars.md
Clojars instructions

Publish Release

  1. Update version in project.clj
  2. lein deploy clojars

Setup

Project

1. Ensure prefix is on project in project.clj

@humorless
humorless / deps.clj
Created October 31, 2022 10:08 — forked from theronic/deps.clj
Convert Clojure project.clj :dependencies to deps.edn style
; using Clojure 1.9
(require '[clojure.pprint :as pprint])
(defn xform-dep [[lib version & korks]]
(let [args (into {} (apply hash-map korks))]
[lib (merge {:mvn/version version} args)]))
(defn xform-deps
"deps.edn utility function by @theronic 2018-02-28
Transforms a collection of project.clj :dependencies to deps.edn style
@humorless
humorless / web-app-dev-tutorial.md
Last active August 4, 2022 04:02
The web application challenges & solutions

The Heretic Web Application Technical Stack

應用軟體開發是很容易遇到坑而做不好、做不快,容易犯下所謂的應用軟體開發七宗罪

需要的 technologies

  1. Software Spec - Event modeling method
  2. Evaluation - The four key metrics
  3. Frontend - htmx
@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