Skip to content

Instantly share code, notes, and snippets.

@mfikes
mfikes / scljs.md
Last active December 29, 2015 10:47
State of ClojureScript

If you look at the 2014 State of ClojureScript survey, these are the top items for What has been most frustrating for you in your use of CLJS?, and my take on work done in these areas is below. It is nothing short of amazing, IMHO.

Therefore I urge you to do the current survey.

  1. Difficulty using ClojureScript REPL: The Node.js REPL was added, as well as a Nashorn REPL, as well as a lot of new "ease-of-use" stuff baked into all base REPLs (doc, pst, etc.). Additionally, a few new ClojureScript REPLs (Ambly, Replete, Planck) rely heavily on new stuff in ClojureScript.
  2. Difficulty debugging generated JavaScript: Source map capability was essentially extended to all REPLs with stack traces automatically being mapped. The
@androclus
androclus / build-emacs.sh
Last active February 3, 2016 13:18 — forked from favadi/build-emacs.sh
Compile latest emacs version (24.5) in Ubuntu 14.04
#!/bin/bash
# Build latest version of Emacs, version management with stow
# OS: Ubuntu 14.04 LTS and 15.04
# version: 24.5
# Toolkit: lucid
set -e
readonly version="24.5"
@favila
favila / wrap-highlighted.cljc
Created August 22, 2015 00:31
Wrap-highlighted, for splitting strings with elasticsearch highlighting.
(defn wrap-highlighted
"Return a vector of string parts where highlighted runs are replaced with (f highlighted-string)."
[f s]
(->> (re-seq #"<em>(.+?)</em>|.+?(?=<em>|$)" s)
(map (fn [[all highlighted]]
(if (nil? highlighted)
all
(f highlighted))))))
Thank you for extending an invitation to speak at HighLoad++. I
sincerely appreciate your consideration.
I am an outspoken advocate for LGBTQ equality; this position is deeply
woven into my work. Clojure From The Ground Up is adamantly
LGBT-inclusive. Jepsen is named after a gay pop anthem and includes
dozens of references to same-sex relationships and trans identities. My
talk slides are populated with bearded nuns, genderqueer punks, and
trans hackers. My twitter feed is about as gay as it is possible to get.
@timsgardner
timsgardner / arcadia_demo
Created July 18, 2015 23:01
arcadia cube, vr demo
(let [ns 'clojure-west.demo]
(require ns)
(in-ns ns)
(use
'clojure.pprint
'clojure.repl
'clojure-west.freeze)
(require
;'[clojure-west.mesh :as mesh]
'[clojure-west.materials :as mat]
@non
non / answer.md
Last active February 28, 2025 11:46
answer @nuttycom

What is the appeal of dynamically-typed languages?

Kris Nuttycombe asks:

I genuinely wish I understood the appeal of unityped languages better. Can someone who really knows both well-typed and unityped explain?

I think the terms well-typed and unityped are a bit of question-begging here (you might as well say good-typed versus bad-typed), so instead I will say statically-typed and dynamically-typed.

I'm going to approach this article using Scala to stand-in for static typing and Python for dynamic typing. I feel like I am credibly proficient both languages: I don't currently write a lot of Python, but I still have affection for the language, and have probably written hundreds of thousands of lines of Python code over the years.

@arocks
arocks / Emacs-Python
Created April 25, 2015 18:08
Outline of my lightning talk "Emacs and Python" at Bangpypers April 2015
# Emacs and Python
## Why?
## Intro
- Arun Ravindran <arunrocks.com> @arocks
- Emacs user for 15 years
- Python user for 13 years
- Author of "Django Design Patterns and Best Practices"
@cgrand
cgrand / transmogrify.clj
Last active August 29, 2015 14:18
transmogrify->> rewrites last-threaded forms to use transducers.
(defmulti transmogrify
"Rewrites the last form of a thread-last to use transducer (if possible)."
(fn [f xform src & args] f))
(defmacro transmogrify->>
"Like ->> but uses transducers"
([x] x)
([src & xs]
(let [end (last xs)
xforms (butlast xs)
@sparkofreason
sparkofreason / util.cljx
Last active January 20, 2016 17:44
Utility functions for bridging Datomic/Datascript
(ns allgress.datascript.util
(:require [clojure.walk :refer [postwalk]]))
;;; Datomic pull API will return :db/idents as references, like {:my-enum-att {:db/ident :enum-value}}.
;;; This function replaces with the Datascript equivalent {:my-enum-att :enum-value}. Only works
;;; for true "enums", whose only attribute in the entity map is :db/ident.
defn replace-enum-refs [entity-map]
(postwalk
(fn [arg]
(if (and (coll? arg) (map? (second arg)) (= 1 (count (second arg))) (contains? (second arg) :db/ident))
@favila
favila / restore_datoms.clj
Last active September 30, 2021 03:50
Restore a datomic database "manually", i.e. from raw datoms. Useful for memory databases. Context: https://groups.google.com/d/msg/datomic/BkTdKYB3WpE/AKfqKYqPONMJ
(ns favila.datomic-util.restore-datoms
"A \"manual\" datomic database restore.
Writes raw datoms (stored in a stream written by d/datoms) to an empty database.
Useful for memory databases: you can write out all the datoms in it, then read
them into another database. (Note mem dbs have no log or retractions)."
(:require [datomic.api :as d]
[clojure.edn :as edn]))
(defrecord datom [e a v tx added?])