the hash code of the first commit
references
git rev-list --parents HEAD | egrep "^[a-f0-9]{40}$"
git rev-list --parents HEAD | tail -1
showing branch name in cygwin prompt
git-prompt.sh
git-prompt.sh 를 받는다.
$ pwd /home/user/bin $ wget https://....
~/.bashrc
~/.bashrc
파일에 다음 내용을 추가한다.
source ~/bin/git-prompt.sh PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]$(__git_ps1 " (%s)")\n\$ '
pull’em all
http://stackoverflow.com/a/40601481/330457
find . -type d -name .git -exec git --git-dir={} --work-tree=$PWD/{}/.. pull \;
윈도에서 putty를 사용하여 serial 제어하기
references
장치관리자
장치관리자를 열어서 serial port 가 어디에 연결되어 있는지 확인한다. 내 경우엔 COM4
에 연결되어 있다.
putty
putty
를 실행하고 다음과 같이 설정한다.
- [
Specify the destination you want to connect to
] 부분에서Serial
을 선택한다.Host
부분에 해당 값을 입력한다. e.g.COM4
Speed
부분에 해당 값을 입력한다. e.g.115200
- [
Load, save or delete a stored session
] 에COM4@115200
등으로 저장해놓으면 나중에 다시 시용할 수 있다.
윈도 시작할 때 pageant 시작하기
references
Windows 10
Windows+R
키를 누르고shell:startup
을 입력하면 시작 아이템들이 모여있는 창이 열린다.- 마우스 오른쪽 버튼 -> New -> Shortcut 을 실행한다.
"Path\To\pageant.exe" "Path\To\id_rsa.ppk"
를 입력한다.
skylife oipf
inspector
http://<ip-address>:19233/inpector.html
How to get the SAID?
var oipfObjectFactory = window.oipfObjectFactory; var oipfConfiguration = oipfObjectFactory.createConfigurationObject(); var SAID = oipfConfiguration.getText('SAID');
orElse, or orElseGet, that is the question:
static String B() { System.out.println("B()..."); return "B"; } public static void main(final String... args) { System.out.println(Optional.of("A").orElse(B())); System.out.println(Optional.of("A").orElseGet(() -> B())); }
format/parse ISO 8601 ignoring the fraction
static Instant parseIsoInstant(final String formatted) { return Instant.from(DateTimeFormatter.ISO_INSTANT.parse(formatted)) .with(ChronoField.NANO_OF_SECOND, 0L); } static String formatIsoInstant(final TemporalAccessor parsed) { return DateTimeFormatter.ISO_INSTANT.format( Instant.from(parsed).with(ChronoField.NANO_OF_SECOND, 0L)); } static Date parseIsoDate(final String formatted) { return Date.from(parseIsoInstant(formatted)); } static String formatIsoDate(final Date parsed) { return formatIsoInstant(parsed.toInstant()); }