Skip to content

Instantly share code, notes, and snippets.

@ptmt
ptmt / rn-cli.config.js
Last active March 8, 2020 16:21
rn-cli.config.js
const path = require('path');
// Don't forget to everything listed here to `package.json`
// modulePathIgnorePatterns.
const sharedBlacklist = [
/node_modules[/\\]react[/\\]dist[/\\].*/,
'downstream/core/invariant.js',
/website\/node_modules\/.*/,
@ptmt
ptmt / rn-cli.config.js
Last active August 1, 2017 12:18
Symlinks workaround with wml
const { execSync, spawn } = require('child_process');
if (process.argv.indexOf('start') > -1) {
console.log('Setting up wml');
const wmlBin = path.join(__dirname, 'node_modules/.bin/wml');
try {
console.log(execSync(`${wmlBin} rm all`).toString());
console.log(
execSync(
`${wmlBin} add ${__dirname}/../module ${__dirname}/node_modules/module --skip-prompt=true`
@ptmt
ptmt / add_flow.sh
Created August 2, 2017 06:54 — forked from djoeman84/add_flow.sh
Add flow to all your JS files
#!/bin/bash
# Based on http://stackoverflow.com/questions/151677/tool-for-adding-license-headers-to-source-files
find . -type f -iname "*.js" -print0 | while IFS= read -r -d $'\0' i;
do
added=$(grep -q @flow $i)
if [[ (!$added) && ( $i != *"node_modules"* ) ]]
then
(echo "" & echo "/* @flow */") > flowificator
cat flowificator $i >$i.new && mv $i.new $i
@ptmt
ptmt / postgres-nas-2016.md
Created December 15, 2018 11:45
Setting up Postgres on NAS

Network storages are really handy when it comes to a lot of disk space. Cheaper disk space available, RAID and after all it's a small server, 1GHz/256MB in my case. I wish I had NAS before.

I bought the one from Western Digital, MyCloud EX2Ultra to be specific, and one of the main reason for that is being able to work with a huge database. Consider Postgres, which runs on my Mac with 256GB, so any database larger than XX Gb is large enough to worry about. You can solve this problem with cloud, but what about 2TB database? 20TB?

My first attempt was about mount drive manually and create the database there:

mount -t smbfs smb://MyCloudEX2Ultra/Public/db db