Skip to content

Instantly share code, notes, and snippets.

Avatar
😉
Nanchatte

Yasuhiro Yamada greymd

😉
Nanchatte
  • Dublin, Ireland
View GitHub Profile
@greymd
greymd / app.log
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: <?xml version="1.0" encoding="UTF-8"?>
<root>
<records>
<record>
<id>A001</id>
<date>1990-01-04</date>
<status>0</status>
</record>
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}'
@greymd
greymd / hibike.dc
Last active Apr 12, 2018
響け!ユーフォニアムをdcのみで
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
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と試し割りの割る数を用意
@greymd
greymd / ddst.md
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
View gist:9527645a73662b641a34d6c07e459ae5
$ dc -e'0[1+ddn10P10>r]srlrx'
1
2
3
4
5
6
7
8
@greymd
greymd / pandoc_gfm.md
Created Dec 11, 2017
pandoc_markdown
View pandoc_gfm.md

[1]{.header-section-number} AAA

AAAの紹介をします

[1.1]{.header-section-number} AAAの背景

これはAAAの背景です

@greymd
greymd / inverse-fizzbuzz.md
Last active Sep 24, 2017
Inverse Fizzbuzz with Egison
View inverse-fizzbuzz.md
@greymd
greymd / collection2array.egi
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|)
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.