- Static IPs with Vagrant clash easily with other projects
- Dynamic IPs require using port forwards -> port forwards clash with local apps and other projects
- Solution: Provide static IP which are calculated from project name, and then use vagrant-hostupdater to add name -> IP to hosts files for easy use
- Uses 20 first bits from MD5 hash of the name to build IPv4 in Class B private network (smaller addres space than Class A, but rarely used)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(reg-event-fx :get-current-party | |
(fn [{:keys [db]} _] | |
{:db (assoc db :loading? true) | |
:kekkonen {:query :api.party/get-current-party | |
;; called with the body | |
:on-success [:set-current-party] | |
;; or simple assoc-in? | |
:on-success [:assoc-in [:current-party]] | |
}})) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn animated-component [] | |
(let [fade-anim (ui/animated-value. 0)] | |
(r/create-class | |
{:component-did-mount | |
(fn [this] | |
(-> ui/animated | |
(.timing fade-anim #js {:toValue 1 | |
:duration 3000}) | |
(.start))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns foobar.font-awesome | |
(:require [cljsjs.react])) | |
(defn icon [{:keys [name class size rotate flip fixed-width spin pulse stack inverse component] | |
:or {component :span} | |
:as props}] | |
[component | |
(assoc props | |
:class (str "fa fa-" class " " | |
(if size (str "fa-" size)) " " |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns spec-test.core | |
(:require [clojure.spec :as s])) | |
(defn x-integer? [x] | |
(if (integer? x) | |
x | |
(if (string? x) | |
(try | |
(integer/parseint x) | |
(catch exception e |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Called from nREPL started by cider-jack-in | |
(deftask cider-dev [] | |
(comp | |
(watch) | |
(cljs-repl-env) ;; Creates Piggieback env for use in existing nREPL | |
(reload) | |
(less) | |
(cljs))) | |
;; Called from terminal |
Built from the ashes of https://github.com/ngrunwald/ring-middleware-format
Separated concerns:
- Content negotation
- Low level functions?
- Higher level functions for using with Ring request maps?
- Separate namespaces for low-level and Ring stuff?
- Format encoding/decoding implementations
- Formatters?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var db = new PouchDB('mydb'); | |
db.post({}).then(function (result) { // post a new doc | |
return db.get(result.id); // fetch the doc | |
}).then(function (doc) { | |
console.log(doc); // log the doc | |
}).catch(function (err) { | |
console.log(err); // log any errors | |
}); | |
__ _______ __ __ _____ _ _
\ \ / /_ _| \/ | _ / ____| | (_)
\ \ / / | | | \ / | _| |_ | | | | ___ _ _ _ _ __ ___
\ \/ / | | | |\/| | |_ _| | | | |/ _ \| | | | | '__/ _ \
\ / _| |_| | | | |_| | |____| | (_) | | |_| | | | __/
\/ |_____|_| |_| \_____|_|\___/| |\__,_|_| \___|
_/ |
|__/
I hereby claim:
- I am Deraen on github.
- I am juhoteperi (https://keybase.io/juhoteperi) on keybase.
- I have a public key whose fingerprint is 5DDB C334 3CEC 9A95 AB02 72C9 0942 2480 8950 366D
To claim this, I am signing this object: