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 kotlin.math.min | |
object start { | |
infix fun to(other: Int) = RangeTuple(0, other) | |
infix fun to(other: end) = RangeTuple(0, Int.MAX_VALUE) | |
} | |
object end | |
infix fun Int.to(other: end) = RangeTuple(this, Int.MAX_VALUE) |
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/sh | |
# Save this somewhere and call it in a loop of your choice, e.g. | |
# find -name 'scripts.inc' -exec ./inc_to_pory.sh {} \; | |
# to wrap all `scripts.inc` files in raw blocks and rename them to pory or | |
# find -name '*.inc' -exec ./inc_to_pory.sh {} \; | |
# to do the same with *all* .inc scripts in the current folder or subfolders. | |
f="$(echo $1 | rev | cut -c 5- | rev)" | |
echo 'raw `' >> "$f.pory" |
OlderNewer