Instantly share code, notes, and snippets.

😉
Nanchatte

😉
Nanchatte
• Dublin, Ireland
• Sort options
Last active May 25, 2018
app.log
View app.log
 2017-05-09 20:53:26 INFO --- [thread-1] myapp.logic : Register records 2017-05-09 20:53:26 INFO --- [thread-1] myapp.logic : --> POST https://api.example/v2/records http/1.1 2017-05-09 20:53:27 INFO --- [thread-1] myapp.logic : response: A001 1990-01-04 0
Last active Apr 12, 2018
sum digits in the line
View gist:079c4964f04ab03003f35c7e5a9c8dc1
 # https://unix.stackexchange.com/questions/205936/how-can-i-quickly-sum-all-numbers-in-a-file/205939 perl -pe 's/\d*/\$s+=\$&/ge}{\$_=\$s' file perl -F= -pe '\$s+=\$F[1]}{print \$s' file awk -F= '{sum+=\$2};END{print sum}'
Last active Apr 12, 2018

View hibike.dc
 [響] 0:a [け] 1:a [！] 2:a [ユ] 3:a [ー] 4:a [フ] 5:a [ォ] 6:a [ニ] 7:a [ア] 8:a [ム] 9:a 0sc [ lc lC+ 10%;an lC 1+ d sC
Created Apr 10, 2018
dcコマンド素数メモ
View gist:efc0f69d76925e599c32844a767f653a
 ## From: https://en.wikipedia.org/wiki/Dc_(computer_program) ## prime number 2p # A = 2; print A 3p # A = 3; print A ## スタックの先頭にある数とsqrt(処理中の数)を計算 [ # func f-# (int n) int { d # A = n(試す数) l! # B = ! -- nと試し割りの割る数を用意
Last active Mar 31, 2018
Detect daylight saving time with date
View ddst.md
``````\$ echo 20180311" "{01..23}":00:00 JST" | xargs -n3 | TZ=America/New_York gdate -f-
Sat Mar 10 11:00:00 EST 2018
Sat Mar 10 12:00:00 EST 2018
Sat Mar 10 13:00:00 EST 2018
Sat Mar 10 14:00:00 EST 2018
Sat Mar 10 15:00:00 EST 2018
Sat Mar 10 16:00:00 EST 2018
Sat Mar 10 17:00:00 EST 2018
Sat Mar 10 18:00:00 EST 2018
``````
Last active Apr 17, 2018
dc command practice
View gist:9527645a73662b641a34d6c07e459ae5
``````\$ dc -e'0[1+ddn10P10>r]srlrx'
1
2
3
4
5
6
7
8
``````
Created Dec 11, 2017
pandoc_markdown
View pandoc_gfm.md

AAAの紹介をします

これはAAAの背景です

Last active Sep 24, 2017
Inverse Fizzbuzz with Egison
View inverse-fizzbuzz.md
Created Sep 23, 2017
Convert Collection to Array in Egison
View collection2array.egi
 (define \$collection2array 1#(generate-array (nth \$ %1) [1 (length %1)])) ; > (collection2array {a b c}) ; (|a b c|)
Created Sep 21, 2017

View gist:3581be4933ec1c8dc52327d435f49356
 愛 11100110 10000100 10011011 \$ seq 1 1023 | dec2bin | sed 's/^/0000000000/' | grep -oE '.{12}\$' | awk -vFS= -vOFS= '{print 111,\$1,\$2,11,\$3,1,\$4,\$5,\$6,\$7,1,\$8,\$9,1,\$10,\$11,11,\$12,11}' | perl -nle 'print pack ("B*", \$_);' | grep 生 生 \$ seq 1 1023 | dec2bin | sed 's/^/0000000000/' | grep -oE '.{12}\$' | awk -vFS= -vOFS= '{print 111,\$1,\$2,11,\$3,1,\$4,\$5,\$6,\$7,1,\$8,\$9,1,\$10,\$11,11,\$12,11}' | perl -nle 'print pack ("B*", \$_);' | grep 死 死
You can’t perform that action at this time.