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 java.util.* | |
import java.lang.Integer.parseInt | |
typealias Coord = Pair<Int, Int> | |
fun Coord.x() = first | |
fun Coord.y() = second | |
typealias Move = Pair<Direction, Coord> |
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 bash | |
# https://stackoverflow.com/questions/288512/resizing-a-window-to-a-set-size-in-linux | |
wmctrl -l | |
wmctrl -r "Battlefield™ V" -e 0,0,0,1920,1280 |
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
[Unit] | |
Description=Make the screen come back after waking from suspend | |
After=suspend.target | |
[Service] | |
Type=oneshot | |
ExecStartPre=/bin/sleep 5s | |
ExecStart=/home/torgeir/bin/after-sleep.sh | |
[Install] |
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
var o = {} | |
var m = new Map() | |
m.set(o, 42) | |
m.get({}) // undefined | |
m.get(o) // 42 | |
var s = new Set() | |
s.add(1) | |
s.add(2) | |
s.add(2) |
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
dd if=/dev/zero of=test.img bs=1G count=5 oflag=dsync && rm test.img | |
# 5+0 records in | |
# 5+0 records out | |
# 5368709120 bytes (5,4 GB, 5,0 GiB) copied, 3,69591 s, 1,5 GB/s |
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
# Install a bunch of Windows DLLs needed to make Native work | |
# https://ubuntuhandbook.org/index.php/2021/05/wine-6-9-released-install-in-ubuntu-21-04-20-04/ | |
sudo apt install --install-recommends winehq-staging | |
wine 'wineboot' | |
sudo apt install winetricks | |
# on manjaro with x11 this worked fine | |
winetricks vcrun2013 gdiplus urlmon | |
# on arch with wayland (amd) I needed | |
winetricks dxvk vcrun2013 gdiplus urlmon |
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://xerces.apache.org/xerces2-j/faq-dom.html | |
private val loadSaveSerializer by lazy { | |
val registry = DOMImplementationRegistry.newInstance() | |
val domImplementation = registry.getDOMImplementation("LS") as DOMImplementationLS | |
domImplementation.createLSSerializer() | |
} | |
loadSaveSerializer.writeToString(..) |
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
[ | |
{ | |
"json": "{\"type\":\"MultiLineString\",\"coordinates\":\"[[[11.36588,61.13079], ... , [11.007229,61.572116]]]\",\"properties\":{\"description\":\"Stengt på grunn ... . \"}}" | |
}, | |
... | |
{ | |
"json": "{\"type\":\"LineString\",\"coordinates\":\"[[10.402729,62.429979], ... ,[10.335529,62.561779]]\",\"properties\":{\"description\":\"Stengt på grunn ... .\"}}" | |
} | |
] |
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
xrandr --output eDP1 --off | |
#xrandr --output DP1 --off | |
xrandr \ | |
--display :0 \ | |
--output VIRTUAL1 --off \ | |
--output eDP1 --off \ | |
--output DP1 --primary --mode 1024x768 --pos 0x0 --rotate normal --auto \ | |
--output DP2 --off \ | |
--output HDMI2 --off \ |