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
| # https://www.gnu.org/software/make/manual/html_node/Automatic-Variables.html | |
| b/%.dep1: | |
| mkdir -p b | |
| touch "$@" | |
| b/%.dep2: | |
| mkdir -p b | |
| touch "$@" |
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
| # gnuplot < file.plot > file.svg | |
| $data << EOD | |
| # index 0 | |
| 1 2 | |
| 2 2 | |
| 3 3 | |
| # two blank new index 1 |
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
| (echo "HTTP/1.1 200" ; echo "Accept-Ranges: bytes" ; echo ; dd if=file bs=1 count=80000) | nc -l -p 8080 |
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
| docker run --rm --user=$UID:$GROUPS -v "$PWD:$PWD" -w "$PWD" --entrypoint=ffmpeg mwader/ydls -i "$i" -c:a copy -c:v h264 -c:s mov_text -vf yadif=deint=interlaced,format=yuv420p -map 0:a -map 0:v:0 -map 0:s? -movflags +faststart out.mp4 | |
| put paths in list | |
| for i in $(cat list) ; do docker run --rm --user=$UID:$GROUPS -v "$PWD:$PWD" -w "$PWD" --entrypoint=ffmpeg mwader/ydls -y -i "$i" -c:a copy -c:v h264 -c:s mov_text -vf yadif=deint=interlaced,format=yuv420p -map 0:a -map 0:v:0 -map 0:s? -movflags +faststart $i.x264.mp4 ; 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
| See what gcc thinks is native: gcc -Q -mcpu=native --help=target | |
| How native guess works for ARM: | |
| https://github.com/gcc-mirror/gcc/blob/34a6c43487caf3a2a0ec9c7c79c526d116abc8b9/gcc/config/arm/driver-arm.c | |
| https://github.com/gcc-mirror/gcc/blob/16e2427f50c208dfe07d07f18009969502c25dc8/gcc/config/arm/arm-cpus.in |
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
| alias nag="osascript -e \"display notification \\\"Finished with exit code \$?\\\"\"" | |
| Usage: | |
| ./command_that_takes_time ; nag |
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
| package main | |
| import ( | |
| "fmt" | |
| "path/filepath" | |
| "runtime" | |
| ) | |
| func FFL() string { | |
| pc, f, l, _ := runtime.Caller(1) |
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
| // Package naivediff generates a unified diff between two texts wih the same amount of lines | |
| // WARNING: Is naive because it assumes source and destination text have the same number of lines. | |
| // Should only be used to make changes to lines, not add or delete lines. | |
| package naivediff | |
| import ( | |
| "fmt" | |
| "strings" | |
| ) |
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
| in program: | |
| func init() { | |
| if lf := os.Getenv("LOGFILE"); lf != "" { | |
| log.SetOutput(func() io.Writer { f, _ := os.Create(lf); return f }()) | |
| } | |
| } | |
| or |
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
| # requires rlwrap and iprint | |
| # brew install rlwrap iprint | |
| # apt-get install rlwrap iprint | |
| rlwrap -C calc sh -c '(test $# -gt 0 && echo $* || cat) | while read l ; do n=$(echo $(($l))) && i $n ; done' -- | |
| # as bash alias | |
| alias c="rlwrap -C calc sh -c '(test \$# -gt 0 && echo \$* || cat) | while read l ; do n=\$(echo \$((\$l))) && i \$n ; done' --" |