$ uname -r
This file contains 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
// maybe we could add this one into Play... | |
// Reads a JsArray and then map on its elements applying Reads (cumulating errors) | |
def readJsArrayMap[A <: JsValue](transformEach: Reads[A]): Reads[JsArray] = Reads { js => js match { | |
case arr: JsArray => | |
arr.value.foldLeft(JsSuccess(Seq[JsValue]()): JsResult[Seq[JsValue]]) { (acc, e) => | |
acc.flatMap{ seq => | |
e.transform(transformEach).map( v => seq :+ v ) | |
} | |
}.map(JsArray(_)) | |
case _ => JsError("expected JsArray") |
This file contains 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
os: linux | |
language: node_js | |
node_js: | |
- "8" | |
install: | |
- npm install | |
cache: | |
directories: | |
- node_modules | |
script: |
This file contains 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
#!/bin/bash | |
# | |
# NOTE: specify the absolutepath to the directory to use when | |
# loading a plugin. '~' expansion is supported. | |
# | |
chunkc core::plugin_dir /usr/local/opt/chunkwm/share/chunkwm/plugins | |
# |
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');
Those suck for maintenance and they're ugly.
Fish is a smart and user-friendly command line (like bash or zsh). This is how you can instal Fish on MacOS and make your default shell.
Note that you need the https://brew.sh/ package manager installed on your machine.
brew install fish