This file contains hidden or 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
| fzf --preview="head -n 20 {}" | |
| find . -type f -name "*RequestInfo.java" | fzf --preview="head -n 30 {}" | |
| # same | |
| fzf --query="RequestInfo.java$" --preview="head -n 30 {}" | |
| # almost same | |
| fzf --filter="RequestInfo.java$" --preview="head -n 25 {}" | |
| # Case insensitive regex | |
| fzf --filter="(?i)RequestInfo.java$" --preview="head -n 20 {}" |
This file contains hidden or 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 | |
| # set -x | |
| set -e | |
| declare -a PIDS | |
| LOG_DIR="logs" | |
| TIMESTAMP=$(date +%Y%m%d_%H%M%S) | |
| DEBUG_PORT=5000 | |
| mkdir -p "$LOG_DIR" |
This file contains hidden or 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
| ____ _ ___ | |
| _____ | _ \| | / _ \ ____ | |
| _____ | |_) | | / /_\ \ ______ | |
| _____ | ___/| |__ / /---\ \ _______ | |
| _____ |_| |____|/_/ \_\ ________ | |
This file contains hidden or 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.io.*; | |
| import java.nio.file.*; | |
| import java.util.concurrent.*; | |
| public class CsvConcurrentProcessor { | |
| static final int NUM_CONSUMERS = 4; | |
| static final int QUEUE_CAPACITY = 1000; | |
| static final BlockingQueue<String[]> queue = new LinkedBlockingQueue<>(QUEUE_CAPACITY); | |
| static final String POISON_PILL = "__EOF__"; |
This file contains hidden or 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 | |
| status=$(curl -I $1 2>/dev/null | head -n 1 | cut -d$' ' -f2) | |
| while [ $status -ne 200 ]; | |
| do | |
| echo ret is: [$status] | |
| status=$(curl -I $1 2>/dev/null | head -n 1 | cut -d$' ' -f2) | |
| done |
This file contains hidden or 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 | |
| free=$(df -h / | tail -n 1 | awk '{print $4}') | |
| total=$(df -h / | tail -n 1 | awk '{print $2}') | |
| use=$(df -h / | tail -n 1 | awk '{print $5}') | |
| echo Free/Total memory: $free / $total | |
| echo Percentage: $use | sed 's/%//' |
This file contains hidden or 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
| from dataclasses import dataclass | |
| import random | |
| @dataclass | |
| class States: | |
| start: str = "start" | |
| gameover: str = "gameover" | |
| next: str = "next" |
This file contains hidden or 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 schedule | |
| import time | |
| """ | |
| period interval | |
| input-> 12:22 hours,... | |
| input-> :22 seconds,... | |
| input-> 12 minutes,... | |
| """ |
This file contains hidden or 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 schedule | |
| import time | |
| """ | |
| period type | |
| input-> 12:22 hours,... | |
| input-> :22 seconds,... | |
| input-> 12 minutes,... | |
| """ |
This file contains hidden or 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 schedule | |
| import time | |
| """ | |
| period interval | |
| input-> 12:22 hours,... | |
| input-> :22 seconds,... | |
| input-> 12 minutes,... | |
| """ |