Skip to content

Instantly share code, notes, and snippets.

View karad's full-sized avatar

kazuhiro hara karad

View GitHub Profile
// Discord all events!
// A quick and dirty fleshing out of the discord.js event listeners (not tested at all!)
// listed here -> https://discord.js.org/#/docs/main/stable/class/Client
// Learn from this, do not just copy it mofo!
//
// Saved to -> https://gist.github.com/koad/316b265a91d933fd1b62dddfcc3ff584
// Last Updated -> Halloween 2022
/*
@jasonzoladz
jasonzoladz / page-transitions.cljs
Last active October 19, 2023 15:33
Animating Page Transitions with Reagent and Re-frame
;; style.css -- basic (lame) transitions, for demonstration
;;________________________________________________________________
.pageChange-enter {
opacity: 0.01;
}
.pageChange-enter.pageChange-enter-active {
opacity: 1;
transition: opacity 500ms ease-in;
@jasongilman
jasongilman / atom_clojure_setup.md
Last active May 11, 2024 02:25
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.

@tnoda
tnoda / agenda.org
Created March 30, 2015 01:41
3/31 gen-class 勉強会@HaLake プログラム案

gen-class 勉強会 プログラム

No.タイトル担当レベル
1Java のクラスの作り方@tnoda\_未経験者
2Docstring 逐条講義@tnoda\_ビギナー
3gen-class の内部実装の話@athos0220上級者
4アノテーションの使い方@tnoda\_中級者
5gen-class クイズ@tnoda\_中級者
@eldritchideen
eldritchideen / project.clj
Last active April 2, 2024 16:00
Web scraping in Clojure with Jsoup
(ns scraping.core
(:gen-class)
(:import (org.jsoup Jsoup)
(org.jsoup.select Elements)
(org.jsoup.nodes Element)))
(def URL "http://www.smh.com.au/business/markets/52-week-highs?page=-1")
(defn get-page []
(.get (Jsoup/connect URL)))
@t-model
t-model / SampleAQS.scala
Last active August 29, 2015 13:56
akka-quartz-scheduler
//app/batch/SampleAQS.scala
package batch
import play.api._
import play.api.Play.current
import play.api.libs.concurrent.Akka
import play.api.libs.concurrent.Execution.Implicits.defaultContext
import akka.actor.{Actor, ActorSystem, Props}
import com.typesafe.akka.extension.quartz.QuartzSchedulerExtension
@neotyk
neotyk / korma_for_update.clj
Created September 10, 2013 08:53
Hack to make Korma select for update
(ns korma-for-update
(:require [clojure.test :refer :all]
[korma.core :refer [entity-fields defentity select* as-sql exec-raw]]
[korma.db :refer (postgres defdb)]))
;; TODO: use your local db
(defdb local (postgres {:db "neotyk"
:user "neotyk"
:host "localhost"
:password ""}))
@Chouser
Chouser / externs_for_cljs.clj
Created June 17, 2013 13:44
Generate an externs.js file for arbitrary JS libraries for use in advanced Google Closure compilation, based on the ClojureScript code that uses the libraries.
(ns n01se.externs-for-cljs
(:require [clojure.java.io :as io]
[cljs.compiler :as comp]
[cljs.analyzer :as ana]))
(defn read-file [file]
(let [eof (Object.)]
(with-open [stream (clojure.lang.LineNumberingPushbackReader. (io/reader file))]
(vec (take-while #(not= % eof)
(repeatedly #(read stream false eof)))))))
@syou6162
syou6162 / clj-seq-utils.md
Created September 6, 2012 00:24
Clojureのsequence関係のユーティリティ関数のまとめ

sequence関係のユーティリティ関数で自分がよく知らないものをまとめておく。

map-indexed

昔はindexedっていうそのまんまな関数があったけど、1.3くらいからなくなっていた。今はmap-indexedっていう関数を使う。よく使うのはこんな感じの使い方。

(map-indexed #(vector %1 %2) ["a" "b" "c" "d" "e"])
; ([0 "a"] [1 "b"] [2 "c"] [3 "d"] [4 "e"])

reductions