Jim Cheung

Sunday, April 01, 2018

$ sudo npm install -g create-react-native-app
$ create-react-native-app lemar
$ sudo sysctl -w fs.inotify.max_user_instances=1024
$ sudo sysctl -w fs.inotify.max_user_watches=12288

install the expo app on mobile and open it, then run

$ cd lemar
$ npm start

and follow instructions, you should able to have a live reload development environment to code with react native, basicially it's all javascript

when you want to build the binary, .apk for example, run

$ exp build:android

you'll need an expo account to continue, usually I don't register accounts for development tools, but I don't want to build binary on my old laptop ...

the build process is quite slow, take about 15 minutes for my quick project.

but it works and the whole experience is good.

next I will try their Using ClojureScript guide

Monday, April 02, 2018

cloudflare is Announcing 1.1.1.1: the fastest, privacy-first consumer DNS service

my colleague told me one fun fact about 1.0.0.1: you can just use 1.1

same as 127.0.0.1, you can just use 127.1, and

0 for 0.0.0.0 (in my machine resolve to 127.0.0.1)

the detailed answer can be found in inet_aton() man page:

a.b

Part a specifies the first byte of the binary address. Part b is interpreted as a 24-bit value that defines the rightmost three bytes of the binary address. This notation is suitable for specifying (outmoded) Class C network addresses.

a

The value a is interpreted as a 32-bit value that is stored directly into the binary address without any byte rearrangement.


Lambda Island has a really funny episode about ed: 40. The Ultimate Dev Setup

I think I really like the idea and started practice with ed:

$ rlwrap ed -p'> '

Saturday, April 14, 2018

combining ed and less can navigate and do minor update very fast.

first, add an environment variable LESSEDIT, less default uses vi (or $VISUAL, $EDITOR), however it also passes +[line_num] to the editor which is not valid for ed

so a simple way to fix is add to .bashrc:

export LESSEDIT='rlwrap ed -p " >" %f'

%f is the filename

in order to display line number under less, type -N to toggle

Sunday, April 15, 2018

I bought Ed Mastery and finished in 2 days.

The book is short but I like the writing style, I put my reading notes here


ed itself doesn't support autocomplete, but rlwrap does

just append -r flag:

$ rlwrap -r ed -p "> " foo.txt

for filename completion, add -c flag

then I found out you can have autocomplete under sqlite, mysql etc...

for mysql, start client with mysql --auto-rehash

Wednesday, April 18, 2018

Announcing GraalVM: Run Programs Faster Anywhere

more details on their official site

I tried it with some simple clojure program, it's amazing!

the compiled programs start fast like it's written in go

some failed to compile, I saw a trick on r/clojure:

$ native-image -cp `lein cp`:target/uberjar/hello-0.1.0-SNAPSHOT-standalone.jar hello.core

Wednesday, April 25, 2018

clojure:

saw this on r/clojure subreddit:

run gist directly from command line:

$ clojure -Sdeps '{:deps {hello-clojure {:git/url "https://gist.github.com/athos/b68b15b08efedffaf14d8c020b125202" :sha "1c9a05106171f97f9b8e8ac8f58c7bd8dbe021f9"}}}' -m hello-clojure

essentially a clojure playground

a nice summary on clojure build tools: All the Paths

another summary on what clojure can help you: How Clojure helps you build powerful abstractions


databases:

FoundationDB is Open Source, check their Technical Overview page

on the same day Oracle Announcing General Availability of MySQL 8.0

the cluster mode is interesting but I don't have time to dive in yet: MySQL InnoDB Cluster 8.0 – A Hands-on Tutorial

a story about entity-attribute-value data model (which datomic uses): A Massively Multi-user Datastore, Synced with Mobile Clients

two datomic article:

a quick datomic setup from r/clojure:


some other interesting tools/links:

about the last link: people said Portacle is easier to setup a fresh common lisp environment.

Thursday, April 26, 2018

some ssh config to speed up (for git pull etc.)

ControlMaster auto
ControlPath ~/.ssh/sockets/%r@%h-%p
ControlPersist 600

force the connection to be closed by using ssh $host -O exit

Blog Archive