$ curl -so- http://ftp.gnu.org/gnu/bash/ | grep -oP "bash-.*?tar.gz" | uniq | grep -v doc
bash-1.14.7.tar.gz
bash-2.0.tar.gz
bash-2.01.1.tar.gz
bash-2.01.tar.gz
bash-2.02.1.tar.gz
bash-2.02.tar.gz
bash-2.03.tar.gz
bash-2.04.tar.gz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
curl -so- http://qiita.com/advent-calendar/2016/categories/programming_languages | \ | |
grep -oP '(?<=<a href=")/advent-calendar/2016/[^"]+?(?=")' | \ | |
sort | uniq | while read s; do printf "$s "; curl -so- "qiita.com$s" | \ | |
grep -oP '(?<= fa-thumbs-up"></i>).*?(?=</li>)'; sleep 1 ;done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; ひねくれた方法な気がする。 | |
(map | |
3#(match [%1 %2 %3] something { | |
[[_ ,0 ,0] FizzBuzz] | |
[[_ ,0 _] Fizz] | |
[[_ _ ,0] Buzz] | |
[[$i _ _] i]}) | |
(map 1#[%1 (modulo %1 3) (modulo %1 5)] (take 100 nats))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ echo {'yes " " | (',"mapfile -tc "{'3 -C "echo fizz"','5 -C "echo buzz"','1 -C "echo @"'}" -n100 -O 1;",')'} | \ | |
bash | sort -k2,2n | awk '{a[$NF]=$1""a[$NF]}END{for (k in a){print k,a[k]}}' | tr -d '@' | |
$ :() { bc <<<"print $1%3;$1%5" | tr -d '[1-9]' | sed 's/0/Fizz/;s/0/Buzz/'; }; mapfile -n 100 -O 1 -c 1 -C ':' < <(yes) | nl -ba |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage | |
## Example 1 (Text) | |
# $ echo foobar | wpbcopy | |
# $ wpbpaste | |
# foobar | |
## Example 2 (Binary) | |
# $ cat image.jpg| wpbcopy | |
# $ wpbpaste | file - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
yes "⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏" | tr ' ' '\n' | while read s; do | |
printf " $s"$'\r' | |
perl -e 'select(undef, undef, undef, 0.25)' | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ nl -v10 -i10 -s$'\n' -nln /dev/zero | head -n 10 | sed -e '5i\\\\:\\:\\:' -e ';7i\\\\:\\:' | nl -ba | |
1 10 | |
2 20 | |
3 30 | |
4 40 | |
50 | |
60 | |
1 70 | |
2 80 | |
3 90 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Terminal1 | |
``` | |
$ mkfifo backpipe | |
$ nc -l 8080 < backpipe | curl example.com > backpipe | |
``` | |
Terminal2 | |
``` | |
$ curl example.com -x 'localhost:8080' | |
<result> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.stream.IntStream; | |
class Main { | |
public static void main(String args[]) { | |
IntStream.rangeClosed(2, 100) | |
.filter(i -> IntStream.rangeClosed(2, (int)Math.sqrt(i)) | |
.allMatch(j -> i%j != 0)) | |
.forEach(n -> { | |
System.out.println(n); | |
}); |
Ref:https://togetter.com/li/1041621
$ echo "$(vim -Esc "put = join(split(repeat('響け!ユーフォニアム',11),'.\{11}\zs'), '\\x0a')" -c 'print|q!')"
響け!ユーフォニアム響
け!ユーフォニアム響け
!ユーフォニアム響け!
ユーフォニアム響け!ユ
ーフォニアム響け!ユー
フォニアム響け!ユーフ