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'> '
  • a: insert mode (insert to buffer)
  • .: exit insert mode
  • w [file]: write to file
  • f [file]: set file, then can write simply using w
  • e [file]: edit file and set current file name
  • p: print current line
  • 1p: print first line
  • ,p: print all lines
  • ,n: like ,p but shows line numbers
  • d: delete current line
  • 2d: delete line 2
  • ,d: delete all lines
  • r [file]: read file and append to buffer
  • u: undo
  • s/foo/bar/g: substitution current line
  • ,s/foo/bar/g: substitution all lines
  • 2, 2,3, ,, ?lin?: print lines
  • -, +, ++, -2: move cursor up or down
  • !grep n %: !: exec shell, %: current file name
  • w !clj: pipe buffer to shell command

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

Blog Archives

Search Blog: