First install clojure so the clj command will be available.
brew install clojure
Clone and move core.cljs to the right directory:
git clone https://gist.github.com/a6427534ea76cd4e9222a76eb398b289.git inc
cd inc
| { | |
| /* Keybindings for emacs emulation. Compiled by Jacob Rus. | |
| * | |
| * This is a pretty good set, especially considering that many emacs bindings | |
| * such as C-o, C-a, C-e, C-k, C-y, C-v, C-f, C-b, C-p, C-n, C-t, and | |
| * perhaps a few more, are already built into the system. | |
| * | |
| * BEWARE: | |
| * This file uses the Option key as a meta key. This has the side-effect | |
| * of overriding Mac OS keybindings for the option key, which generally |
First install clojure so the clj command will be available.
brew install clojure
Clone and move core.cljs to the right directory:
git clone https://gist.github.com/a6427534ea76cd4e9222a76eb398b289.git inc
cd inc
Recently, I upgraded my MacBook Pro from a old, trusty Yosemite to Sierra, and reluctantly had to clean out the old JDK versions I had accumulated over a few years. I also wanted to have a Java 9 JDK to play around with the new module system and API’s.
Good news is that, for a while now, you have been able to install and upgrade multiple versions of JDK using only your shell, without having to deal with Oracle’s graphical installers.
To install Java from scratch, install Homebrew Cask cask-update (you need to have Homebrew already installed) first, then install Java using Cask:
brew tap buo/cask-upgrade & brew tap caskroom/versions
brew cask install java8
How do you send information between clients and servers? What format should that information be in? What happens when the server changes the format, but the client has not been updated yet? What happens when the server changes the format, but the database cannot be updated?
These are difficult questions. It is not just about picking a format, but rather picking a format that can evolve as your application evolves.
By now there are many approaches to communicating between client and server. These approaches tend to be known within specific companies and language communities, but the techniques do not cross borders. I will outline JSON, ProtoBuf, and GraphQL here so we can learn from them all.
| // known-good: Xcode 8, Swift 3 | |
| import Foundation | |
| var standardError = FileHandle.standardError | |
| extension FileHandle : TextOutputStream { | |
| public func write(_ string: String) { | |
| guard let data = string.data(using: .utf8) else { return } |
| (ns simple-hiccup.core | |
| (require | |
| [ring.adapter.jetty :refer [run-jetty]] | |
| [simple-hiccup.middleware :as m] | |
| [simple-hiccup.routes :as r] | |
| )) | |
| (def app | |
| (-> r/routes | |
| m/logger |
: and not ::, and the consing operator conversely is :: instead of :where clauses, only let/in"""data corresponds to type in Elm, and also, Haskell's type corresponds to Elm's type alias($) is (<|), but you don't use it all that much – Elm people like the flipped operator (|>) which lets you build something that reads like a pipeline(|>)(.) is (<<), and a flipped version (>>) exists, but I don't see it used that much either(>>=) is not an available operator and would not be polymorphic (no typeclasses, see below), and is instead commonly named SomeType.andThen – e.g. Maybe.andThen : Maybe a -> (a -> Maybe b) -> Maybe bNOTE (2022-07-09): Xcode finally added this functionality in Xcode 14, please see release notes here:
New Features in Xcode 14 Beta 3
When editing code, the Edit > Duplicate menu item and its corresponding keyboard shortcut now duplicate the selected text — or the line that currently contains the insertion point, if no text is selected. (8614499) (FB5618491)
Should be work with 0.18
Destructuring(or pattern matching) is a way used to extract data from a data structure(tuple, list, record) that mirros the construction. Compare to other languages, Elm support much less destructuring but let's see what it got !
myTuple = ("A", "B", "C")
myNestedTuple = ("A", "B", "C", ("X", "Y", "Z"))