Skip to content

Instantly share code, notes, and snippets.

@jbub
jbub / squash-commits.sh
Created June 12, 2013 15:31
git squash last two commits into one
git rebase --interactive HEAD~2
# we are going to squash c into b
pick b76d157 b
pick a931ac7 c
# squash c into b
pick b76d157 b
s a931ac7 c
Sample project for the "Getting started with JavaFX in Clojure" ( https://coderwall.com/p/4yjy1a ) ProTip.
@michaelsbradleyjr
michaelsbradleyjr / cljs-debug-macros.clj
Last active November 5, 2021 21:36
Macros and functions which facilitate the development and debugging of other macros and their supporting functions within a ClojureScript project.
(ns my-cljs.macros.debug
(:require [cljs.analyzer :as cljs]
clojure.walk))
(declare ap
cljs-macroexpand*
cljs-macroexpand-1*
cljs-macroexpand-all*
cljs-macroexpand
@bcremer
bcremer / gist:7524492
Last active August 5, 2023 23:09
My i3 config.
# .config/i3/config
set $mod Mod4
set $alt Mod1
font pango:Segoe UI 8
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
## Solarized colorshema
@brymck
brymck / clojure_big_o.md
Created January 5, 2014 09:36
Clojure Big-O

Clojure Big-O

op hash-map sorted-map hash-set sorted-set vector queue list lazy seq
conj log32n log2n log32n log2n 1 1 1 1
assoc log32n log2n - - log32n - - -
dissoc log32n log2n - - - - - -
disj - - log32n log2n - - - -
nth - - - - log32n n n n
get log32n log2n log32
@mscharhag
mscharhag / Java8DateTimeExamples.java
Created February 24, 2014 19:53
Examples for using the Java 8 Date and Time API (JSR 310)
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.time.format.FormatStyle;
import java.time.temporal.ChronoUnit;
import java.time.temporal.TemporalAdjusters;
import java.util.*;
import static java.time.temporal.TemporalAdjusters.*;
public class Java8DateTimeExamples {
@scttnlsn
scttnlsn / debounce.cljs
Created March 24, 2014 17:03
core.async debounce
(defn debounce [in ms]
(let [out (chan)]
(go-loop [last-val nil]
(let [val (if (nil? last-val) (<! in) last-val)
timer (timeout ms)
[new-val ch] (alts! [in timer])]
(condp = ch
timer (do (>! out val) (recur nil))
in (recur new-val))))
out))
@rtt
rtt / tinder-api-documentation.md
Last active May 5, 2024 15:28
Tinder API Documentation

Tinder API documentation

Note: this was written in April/May 2014 and the API may has definitely changed since. I have nothing to do with Tinder, nor its API, and I do not offer any support for anything you may build on top of this. Proceed with caution

http://rsty.org/

I've sniffed most of the Tinder API to see how it works. You can use this to create bots (etc) very trivially. Some example python bot code is here -> https://gist.github.com/rtt/5a2e0cfa638c938cca59 (horribly quick and dirty, you've been warned!)

@marcoy
marcoy / async-custom-executor.clj
Last active November 12, 2020 14:14
Change core.async threadpool
;; http://stackoverflow.com/questions/18779296/clojure-core-async-any-way-to-control-number-of-threads-in-that-go-thread
(ns sandbox
(:require [clojure.core.async.impl.concurrent :as conc]
[clojure.core.async.impl.exec.threadpool :as tp]
[clojure.core.async :as async]))
(defonce my-executor
(java.util.concurrent.Executors/newFixedThreadPool
1
(conc/counted-thread-factory "my-async-dispatch-%d" true)))
@ctford
ctford / lenses.clj
Created July 12, 2014 20:40
A Clojure lens implementation based on focus and fmap.
(ns shades.lenses)
; We only need three fns that know the structure of a lens.
(defn lens [focus fmap] {:focus focus :fmap fmap})
(defn view [x {:keys [focus]}] (focus x))
(defn update [x {:keys [fmap]} f] (fmap f x))
; The identity lens.
(defn fapply [f x] (f x))
(def id (lens identity fapply))