Skip to content

Instantly share code, notes, and snippets.

<code_scheme name="TW" version="173">
<ClojureCodeStyleSettings>{
:cljs.core/as-&gt; :only-indent
:cljs.core/assoc 0
:cljs.core/cond-&gt; :only-indent
:cljs.core/cond-&gt;&gt; :only-indent
:cljs.core/defonce :only-indent
:cljs.core/with-meta :only-indent
:cljs.core.async/go :only-indent
:cljs.core.async/go-loop :only-indent
@finalfantasia
finalfantasia / Clojure.plist
Created July 31, 2020 08:33 — forked from stig/Clojure.plist
Clojure language module based on the newlisp package by Seth Dillingham and Pete B. Anonymous.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<!--
ABOUT:
Clojure language module based on the newlisp package by
Seth Dillingham <seth.dillingham@gmail.com>
and Pete B. Anonymous.
@finalfantasia
finalfantasia / an_example_for_transduce_with_completing_reducing_function.clj
Last active February 4, 2020 23:37
An Example for Transduce with Completing Reducing Function
(def lines ["inside every large program"
"is a small program"
"struggling to get out"])
;; a stateful transducer that calculates running total
(defn xf-running-total
[]
(fn [rf]
(let [state (volatile! {})]
(fn
@finalfantasia
finalfantasia / shadow_cljs_and_fireplace_vim_integration.md
Last active March 8, 2023 19:10
Shadow-CLJS and Fireplace.vim Integration
  1. Create an app following the official Shadow-CLJS Quick Start instructions.
  2. Modify shadow-cljs.edn
;; shadow-cljs configuration
{:source-paths
 ["src/dev"
  "src/main"
  "src/test"]

 ;; ADD - CIDER middleware for nREPL (required by fireplace.vim)
@finalfantasia
finalfantasia / doseq_doall_dorun_run!_and_for.md
Last active September 26, 2019 18:53
`doseq`, `doall`, `dorun`, `run!`, and `for`

If you have a lazy-seq with side-effects, you almost certainly don't want to let it out of your sight. You're likely to get very strange behavior unless you're exceedingly careful. Most likely, if you've got a lazy-seq with side-effects you should force it with dorun or doall immediately. Use doall if you care about the values in the produced lazy-seq, otherwise use dorun.

This means that dorun should almost always show up right next to the form producing the lazy-seq, which means doseq is very likely a better choice, as it is more efficient and usually more succinct than dorun combined with a lazy-seq producer.

run! is a convenience function that can take place of (dorun (map ,,,)).

for is in rather a different category, since unlike the others it produces a lazy-seq rather than forcing anything. Use for when it's a more convenient way to express the lazy-seq you want than the equivalent combination of map, filter, take-while, etc.

source: https://groups.goo

@finalfantasia
finalfantasia / javafx_and_openjdk_1.8.md
Last active July 10, 2019 18:24
JavaFX and OpenJDK 1.8

Problem: OpenJDK 1.8 builds don't include JavaFX libraries.

Workaround: (Assuming the platform is GNU/Linux.)

Copy the JavaFX runtime JAR and other related files included in a ZuluFX build (https://www.azul.com/downloads/zulu/zulufx/) to the following locations in the home directory of the OpenJDK 1.8 build:

cp $ZULUFX_HOME/lib/javafx.properties $OPENJDK_HOME/lib/

[
{
"installDate": 1526348348774,
"enabled": true,
"updateUrl": null,
"md5Url": null,
"url": null,
"originalMd5": null,
"name": "clojuredocs.org",
"sections": [
<keymap version="1" name="gnome_shell" parent="Default for GNOME">
<action id="$Copy">
<keyboard-shortcut first-keystroke="ctrl c" />
</action>
<action id="$Cut">
<keyboard-shortcut first-keystroke="ctrl x" />
</action>
<action id="$Paste">
<keyboard-shortcut first-keystroke="ctrl v" />
</action>
<keymap version="1" name="macOS" parent="Mac OS X 10.5+">
<action id="$Cut">
<keyboard-shortcut first-keystroke="meta x" />
</action>
<action id="$Redo">
<keyboard-shortcut first-keystroke="shift meta z" />
</action>
<action id="ActivateVersionControlToolWindow">
<keyboard-shortcut first-keystroke="meta 9" />
</action>
  • run ibus-setup in a terminal
  • switch to Emoji tab of IBus Preferences window
  • click ... button to the right of Emoji chocie input
  • select <Control><Shift>e from Keyboard shortcuts
  • click Delete
  • click OK
  • click Close