start new:
tmux
start new with session name:
tmux new -s myname
{"version":1,"resource":"file:///Volumes/workspace/personal/javascript/taggr/.babelrc","entries":[{"id":"sTz0","timestamp":1667160602415}]} |
// oneAction could be setCountry | |
export const oneAction = params => { | |
return { | |
type: "ONE_ACTION", | |
payload: Promise.resolve(`(value from oneAction ${params})`) | |
}; | |
}; | |
// otherAction could be fetchRegions | |
export const otherAction = params => { |
const PersonMonad = person => { | |
const ValidMon = failList => { | |
return { | |
map: ({ f, error }) => { | |
if (!f(person)) { | |
failList.push(error); | |
} | |
return ValidMon(failList); | |
}, | |
flatMap: ({ f, error }) => { |
class MyClass { | |
static [Symbol.hasInstance](lho) { | |
console.log('with-sugar: is', lho, 'an array?'); | |
return Array.isArray(lho); | |
} | |
} | |
console.log([] instanceof MyClass); // true | |
console.log('my string' instanceof MyClass); // false |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.stream.Collectors; | |
import java.util.stream.Stream; | |
public class StreamFlatMap { | |
public static void main(String[] args) { | |
List<String> list = new ArrayList<>(); |
#!/bin/bash | |
# where to store the sparse-image | |
WORKSPACE=~/Documents/workspace.dmg.sparseimage | |
create() { | |
if [ -f $WORKSPACE ]; then | |
echo "File ${WORKSPACE} already exists"; | |
exit 1; |
#!/bin/bash | |
macos="\x1B" | |
linux="\033" | |
marker=$linux | |
if echo $(uname -a) | grep -q -i "darwin"; then | |
marker=$macos | |
fi |