Skip to content

Instantly share code, notes, and snippets.

View shinseitaro's full-sized avatar
🏠
Working from home

shinseitaro

🏠
Working from home
View GitHub Profile
@jacobobryant
jacobobryant / _howto.md
Last active April 13, 2024 16:37
How to add a toggle button for dark mode with Biff and Tailwind

How to add a toggle button for dark mode with Biff and Tailwind

By default, Tailwind's dark mode classes will take effect automatically if the user's operating system is already set to dark mode. Follow these instructions if you would also like to provide a toggle button so the user can override the operating system setting.

Set darkMode: 'class' in tailwind.config.js:

@lagenorhynque
lagenorhynque / duct-guide.md
Last active November 11, 2022 07:10
ClojureサーバサイドフレームワークDuctガイド

ClojureによるWeb開発のサーバサイドで注目度の高い(マイクロ)フレームワークとしてDuctがあります。

ちょうど1年前の2017年12月に私自身初めてDuctによる簡単なREST APIを試作してみて、その過程をAdvent Calendar記事にしたことがありました。

今回は主にClojure言語のことを知っていてWebアプリ開発に興味のある方向けに、英語も含めてドキュメントのとても少ないDuctというフレームワークがどのようなものなのか、技術的な詳細に踏み込んだ解説を試みます。

ちなみに、執筆時点で参照/動作確認した各種ライブラリのバージョンは、サンプルプロジェクト"hello-duct"のproject.cljの通りです(Duct最新安定版0.11.2のテンプレートのまま)。

Ductとは

@friemen
friemen / profiles.clj
Last active August 21, 2023 07:50
My Leiningen profiles.clj
;; put this into profiles.clj in ~/.lein folder
{:user {:jvm-opts ^:replace ["-Xmx6G" "-XX:-OmitStackTraceInFastThrow"]
:repl-options {:timeout 180000}
:plugins [[cider/cider-nrepl "0.35.1"]
[refactor-nrepl "3.9.0"]
[lein-ancient "1.0.0-RC3"]
[jonase/eastwood "0.3.14"]
[lein-try "0.4.3"]
[lein-cloverage "1.0.13"]
[lein-count "1.0.9"]
@bowmanb
bowmanb / http_server.clj
Last active April 7, 2024 03:02
An example Jetty component using Stuart Sierra's component Clojure library.
(ns my-project.http-server
(:require [compojure.core :as compojure]
[com.stuartsierra.component :as component]
[my-project.my-resource :as my-resource]
[ring.adapter.jetty :as jetty]))
(compojure/defroutes app
my-resource/handler)
(defrecord HTTPServer [port server]
@kohyama
kohyama / clojure-exercises.md
Last active October 19, 2017 08:54
Clojure Exercises / Clojure 演習
@kohyama
kohyama / puyo.clj
Last active October 19, 2017 06:08
ぷよぷよ連鎖 in Clojure
;;; Copyright (c) 2013 Yoshinori Kohyama. Distributed under the BSD 3-Clause License.
(ns puyo
(:require [clojure.test :refer (with-test run-tests are)]
[clojure.set :refer (union)]
[clojure.string :as string]))
(with-test
(defn- fall-one [b s]
(->> (reverse b)
(apply map vector)
@Chouser
Chouser / gmail.clj
Created March 24, 2012 18:18
Send email via gmail from Clojure
(ns foo
(:import (java.util Properties)
javax.mail.internet.MimeMessage
(javax.mail.internet MimeMessage InternetAddress)
(javax.mail Session Transport Authenticator
PasswordAuthentication Message$RecipientType)))
(defn send-gmail [{:keys [from to subject text user password]}]
(let [auth (proxy [Authenticator] []
(getPasswordAuthentication []
(ns intro-seq.core
(:use [clojure.contrib seq]))
;; Clojure初心者向けに覚えておくと便利なシーケンス操作関数の使用例を列挙する
;; 1.2でclojure.coreに移動し、廃止予定(DEPRECATED.)になってるのもある
;; 全部で18個(DEPRECATEDは8個)
;; 使用頻度高そう系(4個)