Skip to content

Instantly share code, notes, and snippets.

Avatar
🐬
architecting & managing

Kent OHASHI lagenorhynque

🐬
architecting & managing
View GitHub Profile
@lagenorhynque
lagenorhynque / delegation.ts
Last active Apr 14, 2021
Subtyping, inheritance and delegation
View delegation.ts
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 {
View introduction-to-metaprogramming.md

メタプログラミング入門


lagénorhynque

(defprofile lagénorhynque
  :id           @lagenorhynque
  :reading      "/laʒenɔʁɛ̃k/"
View list_repositories.clj
#!/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 Feb 16, 2021
A minimal GitHub GraphQL API client implemented as a Python script
View github_graphql_api_client.py
#!/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 Mar 13, 2021
A minimal GitHub GraphQL API client implemented as a babashka (Clojure) script
View github_graphql_api_client.clj
#!/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
View start-presentation.sh
#!/usr/bin/env bash
# npm install -g reveal-md
reveal-md the-world-of-labour-law.md --theme night --highlight-theme monokai-sublime -w "$@"
View simple-dsls-in-clojure.md

Clojureで作る"simple"なDSL


lagénorhynque

(defprofile lagénorhynque
  :id           @lagenorhynque
  :reading      "/laʒenɔʁɛ̃k/"
View introduction-to-graphql.md

GraphQL入門


lagénorhynque

(defprofile lagénorhynque
  :id           @lagenorhynque
  :reading      "/laʒenɔʁɛ̃k/"
@lagenorhynque
lagenorhynque / higher_order_function_spec.clj
Last active Apr 18, 2020
Speccing a higher-order function with clojure.spec (+ test.check)
View higher_order_function_spec.clj
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?)