Let's say there're following 3 CSV files (a, b and c):
t, v
1, 10
2, 20
3, 30
4, 40
# Backup DB | |
docker run \ | |
--rm \ | |
--link running_mongo:mongo \ | |
-v /data/mongo/backup:/backup \ | |
mongo \ | |
bash -c ‘mongodump --out /backup --host $MONGO_PORT_27017_TCP_ADDR’ | |
# Download the dump | |
scp -r USER@REMOTE:/data/mongo/backup ./backup | |
CALL apoc.periodic.iterate(" | |
CALL apoc.load.json('file:///Users/f/source/companies.json') | |
YIELD value UNWIND value.rows AS row RETURN row | |
", " | |
MERGE (c:Company {id: row.id}) | |
ON CREATE SET c.id = row.id, c.name = row.name | |
WITH row | |
UNWIND row.relatedPersons as item | |
MERGE (p:Person {id: item.person.id}) | |
ON CREATE SET p.id = item.person.id, p.name = item.person.name |
#!/bin/bash | |
#DOCKER_REGISTRY_URI=_DOCKER_REGISTRY_URI_ | |
#DOCKER_REGISTRY_USER=_DOCKER_REGISTRY_USER_ | |
#DOCKER_REGISTRY_PASS=_DOCKER_REGISTRY_PASS_ | |
expect <<EOF | |
spawn docker login -u $DOCKER_REGISTRY_USER $DOCKER_REGISTRY_URI | |
while (1) { | |
expect { |
find `pwd` -type d -maxdepth 3 -name 'node_modules' | xargs -n 1 tmutil addexclusion |
// A common redux pattern when dealing with async functions is to use thunk. | |
// This usually means your action returns a new function instead of an action object, | |
// and the thunk middleware will make it all work. Example: | |
const asyncAction = () => dispatch => setTimeout(() => dispatch(someOtherAction()), 10000); | |
// Now: maybe that async stuff going on is calling some API which you don't want to overload | |
// with request, and that's what debounce is for. | |
// This is an example of a debounced function which will only be calleable once every second. | |
import { debounce } from 'lodash'; | |
const debouncedFn = debounce(() => callApi(), 1000, { leading: true, trailing: false }); |
MSYS2 is a minimalist linux/unix shell environment for Windows.
Quote: "A modern replacement for MSYS bringing recent versions of the GNU toolchains, Git and other common Unix command line tools to the Windows platform"
Do all the steps listed here: http://msys2.github.io/
(troubleshooting guide here: https://github.com/msys2/msys2/wiki/MSYS2-installation )