×

Community

b 9 years ago
×

Installing leiningen

b 9 years ago
×

Installing boot

b 9 years ago
×

Build Systems

http://www.lambda.cd/ looks very nice.

cointinuous

  • deployment
  • integration
  • testing
b 9 years ago
×

Running Tests

in the REPL

(use 'clojure.test)
(use 'foo.core-test)
(run-tests 'foo.core-test)

http://stackoverflow.com/questions/21294294/run-tests-from-clojure-repl-and-leiningen

It may be more proper to say:

(require '[clojure.test :refer [run-tests]])

...but that's annoyingly long.

b 9 years ago
×

Error Handling

b 9 years ago
×

GOAL

Collect tips on using Clojure more effectively.

The main practical reason I'm going to study Clojure is so that I can implement the ground forum system.

That means I need to really understand Datomic.

My secondary goal is to get paid work using Clojure.

b 9 years ago
×

lein-try

https://github.com/rkneufeld/lein-try

lein try seesaw
lein try seesaw 1.4.5
lein try clj-time

then

(require '[clj-time.core :as t])
b 9 years ago
×

All About Leiningen Profiles

b 9 years ago
×

~/.lein/profiles.clj

{:user
 {:plugins  [[lein-try "0.4.3"]
             [jonase/eastwood "0.2.1"]
             [refactor-nrepl "1.1.0"]
             [cider/cider-nrepl "0.9.1"]]
  :dependencies [[org.clojure/tools.nrepl "0.2.7"]]}}
  • refactor-nrepl doesn't seem to work with yogthos/pulsar-example
b 9 years ago
×

I want to use a different version of Clojure in the REPL

The authors of leiningen suggest creating a project and changing the :dependencies so that the desired version of Clojure is pulled in.

Then lein repl in the context of the project.

b 9 years ago
×

Emacs Tips

C-c C-k

This compiles your current file within the CIDER session, saving the file first if necessary.

C-c M-n

Switch to the namespace of the current buffer.

C-c M-j

Same as M-x cider-jack-in

q

This closes the error window.

C-M-space

Create a region out of a sexp (or any balanced pair of chars)

C-w

Delete (or kill) region

M-w

Copy region to kill ring

C-y

Paste (or yank)

M-y

This lets you interactively select something from the kill ring to paste.

C-0 C-k

Delete to beginning of line.

M-%

Search and Replace from point to end of file (or the currently selected region). After the first search and replace is finished, you can hit ! to search and replace to the end.

M-x term

This was the terminal emulator I was looking for. Not shell, not eshell, but term.

C-x k

Kill buffer

C-u M-! shell-command

Insert output of shell command.

b 9 years ago
×

ParEdit Mode

C-right

Slurp

C-left

Barf

M-(

Wrap with parentheses.

C-M-f

expression forward

C-M-b

expression backward

b 9 years ago
×

How to use Clojure macros to refactor Clojure code in Emacs

b 9 years ago
×

clj-refactor

https://github.com/clojure-emacs/clj-refactor.el/wiki

In Emacs, a lot of automagic refactoring is provided through elisp functions provided above.

Emacs Live has them by default.

b 9 years ago
×

Clojure Style Guide

b 9 years ago
×

Punctuation

b 9 years ago
×

Customizing Emacs Live

http://overtone.github.io/emacs-live/doc-customisation.html

Files

~/.emacs-live.el

(live-append-packs '(~/.live-packs/your-name-pack))

~/.live-packs/beppu-pack

cp -R ~/.emacs.d/packs/template/user-template-pack ~/.live-packs/beppu-pack

Then, customize!

b 9 years ago
×

Org Mode

Tab

Toggle visibility

C-c .

Insert date

M-ret

Insert heading

M-left, M-right

Raise or lower heading level.

M-up, M-down

Move heading up or down.

b 9 years ago
×

Cheatsheets

b 9 years ago
×

Inferior Lisp Mode

I find this useful for running the Datomic REPL from within Emacs.

M-x run-lisp RET
; let it fail
M-x set-variable RET
inferior-lisp-program RET
"/Users/beppu/opt/datomic-pro-0.9.5206/bin/repl"
M-x run-lisp RET

I can't seem to set-variable until I run run-lisp once and let it fail.

b 9 years ago
×

cider-debug

b 9 years ago
×

ClojureScript - Big Problem

dnolen [6:08 AM]
NPM allows loading 50 versions of the same dep (edited)

dnolen [6:08 AM]
Google Closure uses a global namespace

dnolen [6:08 AM]
these are incompatible.

https://github.com/clojure/clojurescript/wiki/Enhanced-JavaScript-Module-Support

b 9 years ago
×

JavaScript Interop

Specifically, I want to know how to use 3rd party React components together with Reagent.

https://github.com/reagent-project/reagent-cookbook

b 9 years ago
×

The road to a cljs npm package

Track official clojurescript releases

https://github.com/clojure/clojurescript/releases.atom

Automatically create a new cljs package for npm when a new release happens.

Use the following as a base:

https://www.npmjs.com/package/cljs-repl

https://github.com/swannodette/cljs-bootstrap

https://github.com/kanaka/cljs-bootstrap

...

PROFIT!

b 9 years ago
×

Libraries

clj-commons-exec

https://github.com/hozumi/clj-commons-exec

Useful for handling subprocesses.

popen

https://github.com/tebeka/popen

Another library for subprocesses. This might be nice for relatively short-lived processes. Maybe.

conch *

https://github.com/Raynes/conch

This seems to be the best library for dealing with subprocesses in Clojure. I still like the elegant simplicity of popen though.

no.disassemble

https://github.com/gtrak/no.disassemble

A Clojure library designed to let you inspect bytecode of functions and things.

hara.event

http://docs.caudate.me/hara/hara-event.html

Conditions and Restarts for Clojure

hydrox

http://helpshift.github.io/hydrox/

This is a magical documentation generator from @zcaudate.

cats

https://github.com/funcool/cats

Category Theory and Algebraic abstractions for Clojure and ClojureScript. http://funcool.github.io/cats/latest/

I'll learn this stuff some day.

core.match

https://github.com/clojure/core.match

Pattern matching for Clojure. I may investigate this later, but it's not a high priority.

clara-rules

Forward matching rules for Clojure

https://github.com/rbrush/clara-rules

spectre

overcome your fear of nested Clojure data

https://github.com/nathanmarz/specter

instar

spectre's rival

https://github.com/boxed/instar

cuerdas

String manipulation for Clojure(Script)

https://github.com/funcool/cuerdas

pretty

Pretty-print all the things (especially exceptions)

https://github.com/AvisoNovate/pretty

mount

Managing app state -- an alternative to component

https://github.com/tolitius/mount

rigui

Hierarchical Timing Wheels for Clojure and ClojureScript (timers)

https://github.com/sunng87/rigui

fn-fx

A declarative wrapper around JavaFX for building GUIs

https://github.com/halgari/fn-fx

seesaw

A declarative wrapper around Swing for building GUIs

https://github.com/daveray/seesaw

lasync

An executor service (a.k.a. smart pool of threads) that is backed by a ArrayLimitedQueue or LinkedLimitedQueue.

https://github.com/tolitius/lasync

b 9 years ago
×

Functions

b 9 years ago
×

Explanations

b 9 years ago
×

Deployment

b 9 years ago
×

Isomorphic ClojureScript

b 9 years ago
×

Most Popular Libraries

b 9 years ago
×

ClojureScript Made Easy

b 8 years ago
×

ClojureScript Awesome

b 9 years ago
×

Java Interop

b 9 years ago
×

3rd Party JARs

https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html

Although rarely, but sometimes you will have 3rd party JARs that you need to put in your local repository for use in your builds, since they don't exist in any public repository like Maven Central.

b 9 years ago
×

Troubleshooting

b 9 years ago
×

The Clojure Toolbox

b 9 years ago
×

Finding the Schema of a Datomic Database

http://www.learndatalogtoday.org/chapter/4 problem 2

[:find ?attr ?type ?card
 :where
 [_ :db.install/attribute ?a]
 [?a :db/valueType ?t]
 [?a :db/cardinality ?c]
 [?a :db/ident ?attr]
 [?t :db/ident ?type]
 [?c :db/ident ?card]]
b 9 years ago
×

Datomic

Design a Forum Schema

http://docs.datomic.com/schema.html

Also, look at existing schema examples for inspiration and techniques.

b 9 years ago
×

Utility Libs

Medley, Useful, Potpuri, Spectre

b 8 years ago
×

How do I use Datomic from Clojure?

Where do I put the jar?

How do I require it?

Best Practices

http://blog.datomic.com/2015/07/datomic-best-practices.html

b 9 years ago
×

Learn Datalog Today

http://www.learndatalogtoday.org/

mindfuck

http://www.learndatalogtoday.org/chapter/8 problem 1 (recursion???)

Also problem 2 has a recursive solution although I wrote a non-recursive (and dumber) solution that worked within the generous constraints they set.

ACHIEVEMENT

I read the whole site and worked through all the problems on September 17, 2015.

b 9 years ago
×

Thoughts on Datomic so far...

  • It's really easy to join.
  • Rules are nice, but recursive rules are a trip.
  • Now that I have a feel for querying the data, I think I can come up with a schema for a blog or a forum.
  • I just need to learn the mechanics of schema creation, but I have a rough high level understanding of the data model now.
b 9 years ago
×

Datomic Blog Posts

b 9 years ago
×

Datomic Sample Code

b 9 years ago
×

React.js

Om

Reagent

b 9 years ago
×

Reagent Tips

b 9 years ago
×

re-natal

Bootstrap ClojureScript-based React Native apps with Reagent and re-frame

https://www.npmjs.com/package/re-natal

b 9 years ago
×

ClojureScript and React-Native

b 9 years ago
×

New? syntax for cljs <-> js attribute access

https://www.reddit.com/r/Clojure/comments/5jtlvn/is_this_line_achievable_in_cljs/

(def audio-context
  (or js/window.AudioContext 
      js/window.webkitAudioContext))
b 8 years ago
×

Animations

b 9 years ago
+