Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / macOS-arm-setup.sh
Last active February 4, 2022 09:11
Setting up fresh macOS
# 1. Install Brew (warning: at least read install at first)
cat "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
# 2. Install Oh-my-zsh (warning: at least read install.sh at first)
curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | cat
curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
# 4. Install brew packages
brew install mas # appstore done right
@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