bin/datomic backup-db "datomic:ddb://us-east-1/rest/of/url?aws_access_key_id=<ACCESS_KEY_ID>&aws_secret_key=<SECRET_KEY>" file:/home/ian/datomic-backup-`date +"%Y%d%m"`
$ cat .git/hooks/pre-commit | |
#!/bin/bash | |
FOUND=$(git diff-index --cached -U0 HEAD -- | grep DONOTCOMMIT | wc -l) | |
if [[ $FOUND -gt 0 ]]; then | |
echo "pre-commit hook: DONOTCOMMIT detected, commit not allowed" | |
exit 1 | |
fi |
(I wrote a bit about why Emacs and Vim on my blog and thought it might be nice to give some starting point for people that want to try it.)
If you just want to play around with Emacs & Evil mode do the following:
mkdir ~/.emacs.d/
- copy
init.el
into~/.emacs.d/
- Download Emacs from http://emacsformacosx.com
(defn parse-params | |
"Parse URL parameters into a hashmap" | |
[] | |
(let [param-strs (-> (.-location js/window) (split #"\?") last (split #"\&"))] | |
(into {} (for [[k v] (map #(split % #"=") param-strs)] | |
[(keyword k) v])))) |
Emacs packages, features, files, layers, extensions, auto-loading, require
,
provide
, use-package
… All these terms getting you confused? Let’s clear up
a few things.
Emacs files contains code that can be evaluated. When evaluated, the functions, macros and modes defined in that file become available to the current Emacs session. Henceforth, this will be termed as loading a file.
One major problem is to ensure that all the correct files are loaded, and in the
(ns datomic.schema-dump | |
(:require | |
[datomic.api :as d] | |
[clojure.pprint])) | |
(defmethod clojure.pprint/simple-dispatch datomic.db.DbId [v] (pr v)) | |
(defmethod clojure.pprint/simple-dispatch datomic.function.Function [v] (pr v)) | |
(defn database-url [name] | |
(str "datomic:mem://" name)) |
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"))
/** | |
* Returns a promise that has a cancelled method that will cause the callbacks not to fire when it resolves or rejects | |
* @param promise to wrap | |
* @returns new promise that will only resolve or reject if cancel is not called | |
*/ | |
export default function cancellable(promise) { | |
var cancelled = false; | |
const toReturn = new Promise((resolve, reject) => { | |
promise.then(() => { |
(function () { | |
'use strict'; | |
/** | |
* wraps a promise in a timeout, allowing the promise to reject if not resolve with a specific period of time | |
* @param {integer} ms - milliseconds to wait before rejecting promise if not resolved | |
* @param {Promise} promise to monitor | |
* @example | |
* promiseTimeout(1000, fetch('https://courseof.life/johndoherty.json')) |
(ns app.components.react-bootstrap | |
(:require [cljsjs.react-bootstrap] | |
[reagent.core :as r])) | |
(def Alert (r/adapt-react-class (.-Alert js/ReactBootstrap))) | |
(def Button (r/adapt-react-class (.-Button js/ReactBootstrap))) | |
; ... | |
(def FormControl (r/adapt-react-class (.-FormControl js/ReactBootstrap))) ; WARNING: use FormControlFixed for text input controls instead | |
(defn FormControlFixed |