To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
- Homebrew
- Mountain Lion -> High Sierra
;; | |
;; NS CHEATSHEET | |
;; | |
;; * :require makes functions available with a namespace prefix | |
;; and optionally can refer functions to the current ns. | |
;; | |
;; * :import refers Java classes to the current namespace. | |
;; | |
;; * :refer-clojure affects availability of built-in (clojure.core) | |
;; functions. |
require 'rspec/core/rake_task' | |
require 'cucumber/rake/task' | |
namespace :test do | |
desc 'Run RSpec tests' | |
RSpec::Core::RakeTask.new(:spec) do |task| | |
task.rspec_opts = %w[--color --format documentation] | |
task.pattern = 'spec/*_spec.rb' | |
end |
require 'rake/gempackagetask' | |
# RubyGems versioning policy: http://docs.rubygems.org/read/chapter/7 | |
gemspec = Gem::Specification.new do |gs| | |
gs.name = 'name' | |
gs.summary = 'summary' | |
gs.description = File.read(File.join(File.dirname(__FILE__), 'README.md')) | |
gs.requirements = [ 'requirements' ] | |
gs.version = '0.0.1' |
To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
(ns logic.core | |
(:require [clojure.core.logic.pldb :as pldb] ;; facts are now stored in a logic database which requires the pldb ns | |
[clojure.core.logic.fd :as fd] ;; for constraint programming, no need to include include in project.clj | |
[clojure.core.logic :refer :all :exclude [record?]])) ;; I left out ":as :logic" for aesthetics | |
(run* [answer] | |
(== answer 5)) | |
(run* [val1 val2] | |
(== {:a val1, :b 2} |
I just don't understand why people use mount, I must be missing something, its model of each namespace as a component, with state as a global thing in a namespace(maybe I am mistunderstanding this), just seems bad, like sticking (def state (atom {})) in every namespace would be
[6:41] https://github.com/tolitius/mount/blob/master/src/mount/core.cljc#L10-L14
GitHub tolitius/mount mount - managing Clojure and ClojureScript app state since (reset)
A list of commonly asked questions, design decisions, reasons why Clojure is the way it is as they were answered directly by Rich (even when from many years ago, those answers are pretty much valid today!). Feel free to point friends and colleagues here next time they ask (again). Answers are pasted verbatim (I've made small adjustments for readibility, but never changed a sentence) from mailing lists, articles, chats.
How to use:
In an effort to gain at least a superficial understanding of the technical implementation of cryptocurrencies, I recently worked my way through "Learn Blockchains by Building One" using Clojure.
This was a good chance to experiment with using spec in new ways. At work, we primarily use spec to validate our global re-frame state and to validate data at system boundaries. For this project, I experimented with using instrumentation much more pervasively than I had done elsewhere.
This is not a guide to spec (there are already many excellent resources for this). Rather, it's an experience report exploring what went well, what is still missing, and quite a few unanswered questions for future research. If you have solutions for any of the problems I've presented, please let me know!
You don't need to know or care about blockchains to understand the code be