Skip to content

Instantly share code, notes, and snippets.

@allgress
allgress / reagent_datascript.cljs
Last active February 16, 2023 21:16
Test use of DataScript for state management of Reagent views.
(ns reagent-test.core
(:require [reagent.core :as reagent :refer [atom]]
[datascript :as d]
[cljs-uuid-utils :as uuid]))
(enable-console-print!)
(defn bind
([conn q]
(bind conn q (atom nil)))
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active May 19, 2025 18:08
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@attentive
attentive / leaflet-helloworld.cljs
Last active August 29, 2015 14:00
LeafletJS Hello World in Om and ClojureScript
(ns leaflet-helloworld
(:require [om.core :as om :include-macros true]
[om.dom :as dom :include-macros true]))
(defn map-view [_ owner]
(reify
om/IRender
(render [_]
(dom/div #js {:id "the-map"} nil))
om/IDidMount
@staltz
staltz / introrx.md
Last active May 15, 2025 10:37
The introduction to Reactive Programming you've been missing
@john2x
john2x / 00_destructuring.md
Last active May 13, 2025 22:05
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@visualjeff
visualjeff / dockerfile
Created August 7, 2014 20:42
Dockerfile for ember-cli
# Docker version 1.1.2, build d84a070
FROM ubuntu:14.04
RUN apt-get update && apt-get install -y \
git \
software-properties-common \
python-software-properties \
make\
gcc \
g++ \

Last updated: 2017-03-18

Searching for Files

Find images in a directory that don't have a DateTimeOriginal

exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' .

###Output photos that don't have datetimeoriginal to a CSV### Note this can take a long time if you have a lot of jpgs

@jhchabran
jhchabran / 1_google_map.cljs
Last active February 13, 2019 12:00
Google Map component, with reagent and reframe. Questions asked on Clojurians #re-frame's channel.
; Following code is WRONG, see comments for details.
(defn google-map []
(let [pos (subscribe [:current-position])]
(reagent/create-class
{:reagent-render
(fn []
[:div
[:h4 "Map"]
[:div#map-canvas {:style {:height "400px"}}]])
// This will open up a prompt for text to send to a console session on digital ocean
// Useful for long passwords
(function () {
var t = prompt("Enter text to be sent to console, (This wont send the enter keystroke)").split("");
function f() {
var character = t.shift();
var i=[];
var code = character.charCodeAt();
var needs_shift = "!@#$%^&*()_+{}:\"<>?~|".indexOf(character) !== -1
@siers
siers / collect-times
Last active December 16, 2015 12:15
Vim startup time profiler
#!/bin/bash
while sleep 0.5; do vim --startuptime "$@" >(./startup-info) +qall; done
# usage: ./collect-times
# Running this will collect startup times in `times' directory.
# It will run it multiple times so that the averages start converging.
# Whenever you remove a plugin, it gets stored as a different version,
# which will be shown at 'watch ./watcher'.