Skip to content

Instantly share code, notes, and snippets.

View humorless's full-sized avatar

Laurence Chen humorless

View GitHub Profile
@humorless
humorless / sales_forecasting_monte.py
Last active November 2, 2024 10:47
The sales forecasting formula using Monte Carlo method
import numpy as np
import matplotlib.pyplot as plt
# 假設參數
lambda_visits = 5 # 主動拜訪次數的均值
lambda_leads = 3 # 主動找上門的客戶數均值
alpha = 0.1 # 主動拜訪轉換率
beta = 0.5 # 主動找上門轉換率
# 蒙地卡羅模擬
@humorless
humorless / prompt_example.md
Last active November 11, 2024 02:23
Good Prompt

作文評分

對以下文本做寫作能力評分,評分標準參考 IELTS 與 On Writing Well 一書 William Zinsser 的主張。

$$文本

對以下文本做寫作能力評分,使用 IELTS 做為標準尺度。
@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"))
@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 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 / 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