Skip to content

Instantly share code, notes, and snippets.

View hatappo's full-sized avatar
🦙

fumi hata hatappo

🦙
  • 404: Employer not found
  • Tokyo Japan
  • 12:31 (UTC +09:00)
View GitHub Profile
@aputs
aputs / jwt.cljs
Created September 21, 2016 02:01
clojurescript JWT encode/decode (SHA version only)
(ns cljsjs.jwt
(:require
[clojure.spec :as s]
[clojure.string :as str]
[goog.json :as json]
[goog.crypt.base64 :refer [encodeString decodeString]]))
;; https://github.com/Caligatio/jsSHA
;; goog.crypt.hmac produces different signature than nodejs version
(def jssha (js/require "jssha"))
@spradnyesh
spradnyesh / reagent-default-1.cljs
Last active February 10, 2024 20:36
:default-value of :input in reagent when rendering form multiple times
(ns foo
(:require [reagent.core :as r]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; global app-state
(defonce app-state (r/atom {}))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; UI components
@hatappo
hatappo / _apps.sh
Last active August 14, 2025 12:27
apps with dmg on Mac
cd ~/git
git clone https://gist.github.com/9c7e0681f469f2a83d8ea4f968b46022.git
cd ./9c7e0681f469f2a83d8ea4f968b46022
sh ./main.sh
@jasongilman
jasongilman / atom_clojure_setup.md
Last active October 28, 2025 22:34
This describes how I setup Atom for Clojure Development.

Atom Clojure Setup

This describes how I setup Atom for an ideal Clojure development workflow. This fixes indentation on newlines, handles parentheses, etc. The keybinding settings for enter (in keymap.cson) are important to get proper newlines with indentation at the right level. There are other helpers in init.coffee and keymap.cson that are useful for cutting, copying, pasting, deleting, and indenting Lisp expressions.

Install Atom

Download Atom

The Atom documentation is excellent. It's highly worth reading the flight manual.

@voluntas
voluntas / webrtc.rst
Last active March 12, 2026 12:25
WebRTC コトハジメ
@sile
sile / 0_raft.md
Last active May 27, 2024 07:53
Raft(分散合意アルゴリズム)について
@daveliepmann
daveliepmann / localstorage.cljs
Created September 23, 2014 08:23
HTML5 localStorage utility functions for ClojureScript. I find it makes for cleaner code when I wrap the native JS.
(ns localstorage)
(defn set-item!
"Set `key' in browser's localStorage to `val`."
[key val]
(.setItem (.-localStorage js/window) key val))
(defn get-item
"Returns value of `key' from browser's localStorage."
[key]
@mihi-tr
mihi-tr / ZeroPad.clj
Created August 22, 2014 15:21
Zero Pad a number in Clojure
(defn zp "Zero Pad numbers - takes a number and the length to pad to as arguments"
[n c]
(loop [s (str n)]
(if (< (.length s) c)
(recur (str "0" s))
s)))
@john2x
john2x / 00_destructuring.md
Last active March 14, 2026 08:35
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@tokiwoousaka
tokiwoousaka / Main.hs
Last active May 16, 2023 15:26
関数型LT大会発表資料
module Main where
import Game.NovelMonad
import Game.NovelMonad.SimpleInterpreter
import Story
main :: IO ()
main = simpleInterpret defaultConfig novelMain
novelMain :: Novel ()
novelMain = do