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/fish | |
| set -l MONTH (date +"%B") | |
| set -l YEAR (date +"%Y") | |
| set -l SSDIR "$HOME/Pictures/Screenshots/$YEAR-$MONTH" | |
| mkdir -p $SSDIR | |
| if test "$argv[1]" = "display" | |
| if maim /tmp/screenshot.png | |
| xclip -selection clipboard -t image/png -i /tmp/screenshot.png | |
| set -l SSPATH $SSDIR/(date +%s)-(identify -format '%wx%h' /tmp/screenshot.png).png |
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
| find . -name "*.sc" -print0 | xargs -0 -n 1 -I{} cat {} | pcregrep -Mv "^(?<pad> *)#.*\n( (?=\k<pad>).+\n)*" | pcregrep "^[ ]*.+?\$" | wc -l |
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
| sugar let (bindings body...) | |
| let bindings = | |
| fold (result = '(embed)) for binding in (bindings as list) | |
| sugar-match (binding as list) | |
| case (name expr) | |
| cons | |
| qq [let] [name] = [expr] | |
| result | |
| default | |
| error "invalid let syntax" |
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 C functions and sanitize the scope | |
| vvv bind glad | |
| do | |
| let glad = | |
| include | |
| options | |
| .. "-I" module-dir "/glad/include" | |
| "glad/src/glad.c" | |
| do | |
| using glad.extern |
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
| (('(1 2 3) 'reverse) print) | |
| ("hello world" print) | |
| (((4 5 +) 2 >) print) | |
| (module-name print) | |
| ((5 87 +) print) | |
| ((true false and) 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
| semantically-bind-types c2.v vec2 | |
| inline "conv-to" (self) | |
| vec2 self.x self.y | |
| inline "conv-from" (other) | |
| c2.v (unpack other) |
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/fish | |
| # vim ft=fish | |
| set -l MONTH (date +"%m") | |
| set -l YEAR (date +"%Y") | |
| set -l SSDIR "$HOME/Pictures/Screenshots/$YEAR-$MONTH" | |
| mkdir -p $SSDIR | |
| if test "$argv[1]" = "display" | |
| if maim /tmp/screenshot.png | |
| xclip -selection clipboard -t image/png -i /tmp/screenshot.png |
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 import Map | |
| using import Array | |
| using import struct | |
| inline table-lookup (t k) | |
| let kT = (typeof k) | |
| let a m = | |
| Struct.__getattr t 'a | |
| Struct.__getattr t 'm |
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 import struct | |
| # You generally want to use plain structs either to interface with C, or | |
| # to store some pure data (commonly called POD object) that doesn't need any management | |
| struct A plain | |
| a : i32 | |
| struct B | |
| b : i32 | |
| inline __drop (self) |
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
| # | |
| // "ShaderToy Tutorial - Ray Marching for Dummies!" | |
| // by Martijn Steinrucken aka BigWings/CountFrolic - 2018 | |
| // License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. | |
| // | |
| // This shader is part of a tutorial on YouTube | |
| // https://youtu.be/PGtv-dBi2wE | |
| Scopes version by Westerbly (radgeRayden) Snaydley. | |
| let MAX_STEPS = 100 |