Skip to content

Instantly share code, notes, and snippets.

View hatappo's full-sized avatar
🐢

fumihiko hata hatappo

🐢
  • Tokyo Japan
  • 07:04 (UTC +09:00)
View GitHub Profile
@hatappo
hatappo / web.clj
Created May 17, 2023 18:52 — forked from prestancedesign/web.clj
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]]
@hatappo
hatappo / ReNameOfindXargs.sh
Last active November 18, 2021 16:04 — forked from 544/ReNameOfindXargs.sh
findとxargsでファイル名変更、そしてファイル名を戻す。
# カレントディレクトリ直下のマークダウンのファイルすべてに対して、ファイル名の末尾に '.org' を付与する
find ./ -type f -maxdepth 1 -name "*.md" | xargs -I% mv % %.org
# 上とまったく逆の操作。 末尾の '.org' を取り除く。
find ./ -type f -maxdepth 1 -name "*.md.ignore" | sed 's/\.ignore$//' | xargs -I% mv %.org %
# いったん、ファイル名を退避して、ことが終わったらもとに戻す、とかのときに便利。
#!/bin/sh
#
# (1) copy to: ~/bin/ssh-host-color
# (2) set: alias ssh=~/bin/ssh-host-color
#
# Fork from https://gist.github.com/thomd/956095
set_term_bgcolor(){
local R=$1
local G=$2