Skip to content

Instantly share code, notes, and snippets.

View lagenorhynque's full-sized avatar
🐬
architecting & managing

Kent OHASHI lagenorhynque

🐬
architecting & managing
View GitHub Profile
@lagenorhynque
lagenorhynque / delegation.ts
Last active April 14, 2021 02:13
Subtyping, inheritance and delegation
class Quadrangle {
name: string;
width: number;
height: number;
constructor(name: string, width: number, height: number) {
this.name = name;
this.width = width;
this.height = height;
}
getArea(): number {
@lagenorhynque
lagenorhynque / introduction-to-metaprogramming.md
Last active November 11, 2022 06:59
メタプログラミング入門

メタプログラミング入門


(defprofile lagénorhynque
  :id           @lagenorhynque
 :reading "/laʒenɔʁɛ̃k/"
#!/usr/bin/env bb
(ns list-repositories
(:require
[babashka.curl :as curl]
[cheshire.core :as cheshire]
[clojure.pprint :refer [pprint]]
[clojure.string :as str]))
(def auth-token (System/getenv "AUTH_TOKEN"))
@lagenorhynque
lagenorhynque / github_graphql_api_client.py
Created February 16, 2021 12:33
A minimal GitHub GraphQL API client implemented as a Python script
#!/usr/bin/env python
import os
import pprint
import requests
AUTH_TOKEN = os.getenv('AUTH_TOKEN')
GRAPHQL_QUERY = '''
query ($query: String!, $last: Int) {
@lagenorhynque
lagenorhynque / github_graphql_api_client.clj
Last active March 18, 2024 20:46
A minimal GitHub GraphQL API client implemented as a babashka (Clojure) script
#!/usr/bin/env bb
(ns github-graphql-api-client
(:require
[babashka.curl :as curl]
[cheshire.core :as cheshire]
[clojure.pprint :refer [pprint]]))
(def auth-token (System/getenv "AUTH_TOKEN"))
(def graphql-query
@lagenorhynque
lagenorhynque / start-presentation.sh
Last active November 11, 2022 06:59
労働法の世界
#!/usr/bin/env bash
# npm install -g reveal-md
reveal-md the-world-of-labour-law.md --theme night --highlight-theme monokai-sublime -w "$@"
@lagenorhynque
lagenorhynque / simple-dsls-in-clojure.md
Last active November 11, 2022 06:59
Clojureで作る"simple"なDSL

Clojureで作る"simple"なDSL


(defprofile lagénorhynque
  :id           @lagenorhynque
 :reading "/laʒenɔʁɛ̃k/"
@lagenorhynque
lagenorhynque / department_adjacency_list_all.png
Last active November 11, 2022 07:00
RDBでのツリー表現入門
department_adjacency_list_all.png

GraphQL入門


(defprofile lagénorhynque
  :id           @lagenorhynque
 :reading "/laʒenɔʁɛ̃k/"
@lagenorhynque
lagenorhynque / higher_order_function_spec.clj
Last active April 18, 2020 11:19
Speccing a higher-order function with clojure.spec (+ test.check)
dev> (require '[clojure.spec.alpha :as s]
'[clojure.spec.test.alpha :as stest])
nil
dev> (defn twice [f x]
(f (f x)))
#'dev/twice
dev> (s/fdef twice
:args (s/cat :f (s/fspec :args (s/tuple integer?)
:ret integer?)
:x integer?)