Skip to content

Instantly share code, notes, and snippets.

View hatappo's full-sized avatar
🐢

fumihiko hata hatappo

🐢
  • Tokyo Japan
  • 17:34 (UTC +09:00)
View GitHub Profile
@YusukeHosonuma
YusukeHosonuma / jojo.md
Created May 8, 2022 05:35
開発で使えるJOJOの名言集

この○○が金やちやほやされるために技術ブログを書いていると思っているのかァーッ!!

技術ブログを書いていることをアフェリエイト目的とか、PV目的だとか言われた時に。

なるほど完璧な開発プロセスっスねーーーっ不可能だという点に目をつぶればよぉ〜

一見完璧に聞こえるけど、どう考えたって上手く回らない開発プロセスの説明を受けた時に。

理解不能理解不能・・・あ、理解可能

ようやく理解できた時に。

お前は1つの修正が終わったらキチっとコミットしてから次の修正に入るだろう? 誰だってそーする。俺もそーする。

@prestancedesign
prestancedesign / web.clj
Last active August 24, 2023 15:45
Ring session authentication with Reitit
(ns authexample.web
(:gen-class)
(:require [buddy.auth :refer [authenticated? throw-unauthorized]]
[buddy.auth.backends.session :refer [session-backend]]
[buddy.auth.middleware :refer [wrap-authentication wrap-authorization]]
[clojure.java.io :as io]
[compojure.response :refer [render]]
[reitit.ring :as ring]
[ring.adapter.jetty :as jetty]
[ring.middleware.params :refer [wrap-params]]
@borkdude
borkdude / projects.md
Last active January 30, 2024 16:25
clj-kondo, jet, edamame, sci, babashka

Overview of recent projects and how they relate:

  • clj-kondo: Clojure linter, compiled with GraalVM for fast startup. While implementing clj-kondo I realized that analyzed code could not only be linted, but also interpreted. This gave rise to sci.

  • jet: converts between JSON, EDN and Transit. Supports minimal query language in the spirit of jq. While implementing the query language for jet, I realized that using normal Clojure instead of a DSL was better for most Clojure users. This gave rise to sci.

  • edamame: EDN parser with location metadata and configurable dispatch table. This way of parsing is inspired by rewrite-clj, but it skips the intermediate node representation. This parser was extracted from sci.

@furyutei
furyutei / 0.README.md
Last active April 8, 2022 18:09
Userscriptで"Access-Control-Allow-Origin"ヘッダが返らないリソースへのアクセスを試行
@mfikes
mfikes / README.md
Last active September 24, 2023 13:15
eval in ClojureScript

ClojureScript master now has cljs.core/eval. This delegates to cljs.core/*eval* which, by default throws, but you can bind it to any implementation that can compile and evaluate ClojureScript forms.

If you require the cljs.js namespace (which is the main support namespace for self-hosted ClojureScript), then cljs.core/*eval* is set to an implementation that uses self-hosted ClojureScript for this capability. This means that all self-hosted ClojureScript environments will now have a first-class eval implementation that just works. For example, Planck master:

$ planck -q
cljs.user=> (eval '(+ 2 3))
5
@jpickwell
jpickwell / install-redis.sh
Last active May 19, 2023 06:40 — forked from khelll/install-redis.sh
Installing Redis 5.0.0 on Amazon Linux
#!/bin/bash
###############################################
# To use:
# chmod +x install-redis.sh
# ./install-redis.sh
###############################################
version=5.0.0
@kirked
kirked / class-utils.cljs
Last active July 2, 2023 21:31
HTML element class manipulations in Clojurescript (no jQuery)
(defn classes-of
"Get the classes of an element as a Clojure keyword vector."
[e]
(let [words (-> e (.getAttribute "class") (string/split " "))]
(mapv keyword words)))
(defn classes->str
"Change a Clojure keyword seq into an HTML class string."
[classes]
(->> classes (mapv name) (string/join " ")))
@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
@jasongilman
jasongilman / atom_clojure_setup.md
Last active January 11, 2024 09:13
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.