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
| using Statistics | |
| const p = run(pipeline(`arecord -f cd -t raw`, stdout=Pipe()), wait=false) | |
| close(p.out.in) | |
| while true | |
| sleep(0.1) | |
| x = reinterpret(Int16, readavailable(p.out)) | |
| x = @. 20log(10, abs(max(x, typemin(Int16) + one(Int16))) / typemax(Int16)) | |
| println(mean(x)) |
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
| using JSON2 | |
| using OhMyJulia | |
| using ProgressMeter | |
| f = open("maintain.tsv", "w") | |
| prt(f, "service", "category", "product", "type", "tip", "info", "tags", | |
| "brand", "order_quantity", "sales_quantity", "comments", "price", "marketing_price", "unit", "name", "rate", "remark") | |
| import Base.print |
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
| const box1 = ('红', '红') | |
| const box2 = ('红', '蓝') | |
| const box3 = ('蓝', '蓝') | |
| 另一个也是红球的次数 = 0 | |
| 总试验次数 = 0 | |
| while 总试验次数 < 100_000 | |
| # 随机抽取一个盒子 | |
| box = rand([box1, box2, box3]) |
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
| #!/usr/bin/pkexec /usr/bin/zsh | |
| set -x | |
| # clean up before backing up | |
| pacman -Sc | |
| journalctl --vacuum-time=7d | |
| rm /var/lib/systemd/coredump/* | |
| # backup based on last previous one to save disk space | |
| TARGET=/run/media/ylxdzsw/DATA |
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
| # For me, the history is mainly used as a completion dict when I press the up arrow. | |
| # This script removes the lines that does not help serve this purpose | |
| entries = readlines("$(homedir())/.zsh_history") | |
| commands = Set(readlines(`zsh -ic 'print -rl -- ${(k)aliases} ${(k)functions} ${(k)builtins} ${(k)commands}'`)) | |
| filter_but_keep_multiline(f, iter) = let skip = false | |
| filter(iter) do line | |
| if skip | |
| skip = endswith(line, '\\') |
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
| adapta-maia-theme | |
| aircrack-ng | |
| android-tools | |
| aria2 | |
| bat | |
| chromium-ozone | |
| cmake | |
| code | |
| coffeescript | |
| coreutils |
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
| <?xml version="1.0"?> | |
| <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> | |
| <fontconfig> | |
| <alias> | |
| <family>monospace</family> | |
| <prefer> | |
| <family>Droid Sans Mono</family> | |
| <family>Noto Sans Mono CJK SC</family> | |
| </prefer> | |
| </alias> |
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
| #!/usr/bin/env xdg-open | |
| [Desktop Entry] | |
| Version=1.0 | |
| Terminal=false | |
| Type=Application | |
| Name=FFPlay | |
| Exec=ffplay %U | |
| NoDisplay=true | |
| Categories=AudioVideo;Audio;Video;Player; | |
| MimeType=application/mxf;application/ogg;application/ram;application/sdp;application/smil;application/smil+xml;application/vnd.apple.mpegurl;application/vnd.ms-asf;application/vnd.ms-wpl;application/vnd.rn-realmedia;application/vnd.rn-realmedia-vbr;application/x-extension-m4a;application/x-extension-mp4;application/x-flac;application/x-flash-video;application/x-matroska;application/x-netshow-channel;application/x-ogg;application/x-quicktime-media-link;application/x-quicktimeplayer;application/x-shorten;application/x-smil;application/xspf+xml;audio/3gpp;audio/3gpp2;audio/aac;audio/ac3;audio/AMR;audio/AMR-WB;audio/basic;audio/dv;audio/eac3;audio/flac;audio/m4a;audio/midi;audio/mp1;audio/mp2;audio/mp3;audio/mp4;audio/mpeg;audio/mpegurl;audio/mpg;audio/ogg;audio/opus;audio/prs.sid;audio/scpls;audio/vnd.rn-realaudio;audio/wav;audio/webm;audio/x-aac; |
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
| serverchan_token = '' | |
| telegram_token = '' | |
| telegram_chatid = '' | |
| secret = '' # it also acts as instance ID. Change this everytime you restart the script. | |
| host1 = '' | |
| host2 = '' # we need two hosts because of https://community.cloudflare.com/t/issue-with-worker-to-worker-https-request/94472 | |
| addEventListener 'fetch', (e) -> | |
| e.respondWith main e |
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
| <style> | |
| html, body, div { | |
| padding: 0; | |
| margin: 0; | |
| } | |
| #big { | |
| border-radius: 50%; | |
| width: 300px; | |
| height: 300px; |