2020-04-01から1ヶ月間の記事一覧

Show smile in prompt if Git commit hash is lucky

git のコミットハッシュにゾロ目が出ると幸せになきもちになる。 git 茶柱と呼びたい— shinichiro hamaji (@shinh) April 27, 2020 Configuration setopt re_match_pcre ## show git branch at right prompt autoload -Uz vcs_info zstyle ':vcs_info:*' for…

zsh completion macOS screencapture command

It is bundled neither zsh sources nor zsh-completions, so I wrote it. #compdef screencapture __screencapture_files() { for ((i = 2;i < CURRENT;i++)) do if [[ $words[$i] == "-p" ]]; then return fi done _files } _arguments \ '-c[force screen…

WFH雑感

完全 WFHを初めて早二ヶ月が過ぎた. 結論からいると成果はそれほど上がっていないのだが, その中で私が試したことについて示す. 今月半ばぐらいからぼちぼち改善しているような気はするので引き続き改善を行っていきたい 早寝早起き生活に変えた オフィスに…

strlen for string literal

Environment Ubuntu 19.10 GCC 9.2.1 clang-9.0.0-2 Sample code #include <string.h> size_t string_const_size() { return strlen("hello world"); } Compile with gcc -O0 gcc -O0 -c strlen.c objdump -S strlen.o strlen.o: file format elf64-x86-64 Disassembly</string.h>…

Build GCC 4.9.4 x86_64 on Ubuntu 19.10

Apply patch libgcc of gcc4.9.4 has issue on newer environment diff -ur gcc-4.9.4/libgcc/config/i386/linux-unwind.h new-gcc-4.9.4/libgcc/config/i386/linux-unwind.h --- gcc-4.9.4/libgcc/config/i386/linux-unwind.h 2014-01-03 07:25:22.00000000…

Minimum setup for node native module development with VScode

It is difficult to develop node native module without IDE. Because V8 API is difficult to use, complicated, often changed. node-gyp can generate Visual Studio solution file but other IDE is not supported well. I show how to setup writing n…