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
window.AudioContext = window.AudioContext || window.webkitAudioContext; | |
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia; | |
window.addEventListener('load', init, false); | |
function init () { | |
try { | |
record(new AudioContext()); | |
} | |
catch (e) { |
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
SRC = scala | |
SOURCES = $(shell ls $(SRC)/*.scala) | |
S = scala | |
SC = scalac | |
TARGET = target | |
CP = $(TARGET):scalatest.jar | |
SPEC = scala.RomanSpec | |
compile: $(SOURCES:.scala=.class) |
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
#!/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 |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
[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 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 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
$ sudo dscl | |
> cd /Local/Default/ | |
/Local/Default > ls Users uid | |
/Local/Default > create Users/_node UserShell /bin/bash | |
/Local/Default > create Users/_node UniqueID 300 | |
/Local/Default > create Users/_node PrimaryGroupID 300 | |
/Local/Default > create Users/_node NFSHomeDirectory /Users/_node | |
/Local/Default > ls Groups gid | |
/Local/Default > create Groups/_node |
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
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 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 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 ... .\"}}" | |
} | |
] |