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
proc box*[T](val: T): ref T = | |
new result | |
result[] = val |
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 | |
echo '' > ./.borderlands_winid | |
while true; | |
wmctrl -l | grep 'Borderlands' | cut -f 1 -d ' ' > /tmp/bl_new_winid_pt1 | |
sort -u /tmp/bl_new_winid_pt1 .borderlands_winid > /tmp/borderlands_winid_new | |
mv /tmp/borderlands_winid_new ./.borderlands_winid | |
for id in (cat ./.borderlands_winid); | |
xdotool windowmap $id; |
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 | |
1 | |
1 | |
2 | |
3 | |
4 | |
1 | |
2 | |
1 | |
2 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 parseutils, pegs, myutils, strutils, re | |
type | |
Url* = object | |
scheme*, hostname*: String | |
port*: Option[Int] | |
username*, password*: Option[String] | |
path*: String | |
parameters*, fragments*: Option[String] |
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 unsigned | |
type | |
FArray* {.unchecked.} [T] = array[0..1, T] | |
PArray*[T] = ref FArray[T] | |
proc box*[T](val: T): ref T = | |
new result | |
result[] = val |
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
type FArray* {.unchecked.} [T] = array[0..0, T] | |
converter array2FArray[I, T](arr: array[I, T]): FArray[T] = | |
var arr = arr | |
return cast[FArray[T]](addr arr) | |
let x: FArray[int] = [1,2,3,4,5] | |
echo(x[5]) |
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
proc isSeq[T](v: seq[T]): bool = | |
return true | |
proc isSeq[T](v: T): bool = | |
return false | |
let foo = @[1, 2] | |
let fo1 = "ad" | |
echo fo1.isSeq | |
echo foo.isSeq |
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
proc array[I, OT, NT](arr: array[I, OT]): array[I, NT] = | |
for i, v in arr: | |
result[i] = NT(i) | |
let a = array[0..1, int, float]([1, 2]) | |
echo(repr(a)) |