Skip to content

Instantly share code, notes, and snippets.

@torgeir
torgeir / zoom-mute-status-setup.md
Last active Dec 7, 2021
Example configurations for AnyBar and Ubsersicht to get a visual cue representing your zoom mute status. Credits https://gist.github.com/tyhawkins/66d6f6ca8b3cb30c268df76d83020a64
View zoom-mute-status-setup.md
View linux-test-disk-write-speed.sh
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
@torgeir
torgeir / wine-helix-native-vst.log
Created Jul 11, 2021
Wine installing Helix Native 3.11 on Ubuntu Studio 21.01 with wine-staging 6.12
View wine-helix-native-vst.log
# 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
winetricks vcrun2013 gdiplus urlmon
wine $PWD/Downloads/HelixNativev3.11Installer.exe
# install yabridge and follow its installation instructions
# linux reaper will find the vts3 version
@torgeir
torgeir / aws-stream-logs-from-cloudwatch-lambda-es--lambda-code.js
Created Aug 4, 2016
AWS stream logs from "cloudwatch -> lambda -> es" node.js lambda-code
View aws-stream-logs-from-cloudwatch-lambda-es--lambda-code.js
// v1.1.2
var https = require('https');
var zlib = require('zlib');
var crypto = require('crypto');
var endpoint = '<aws es endpoint>';
exports.handler = function(input, context) {
// decode input from base64
var zippedInput = new Buffer(input.awslogs.data, 'base64');
@torgeir
torgeir / minimal-maven-pom.xml
Last active Aug 15, 2021
A minimal maven pom.xml
View minimal-maven-pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>gd.wa</groupId>
<artifactId>minimal-pom</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
@torgeir
torgeir / gulpfile.js
Last active Jul 9, 2021 — forked from markgoodyear/01-gulpfile.js
Example gulpfile.js
View gulpfile.js
// Load plugins
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
jshint = require('gulp-jshint'),
uglify = require('gulp-uglify'),
imagemin = require('gulp-imagemin'),
rename = require('gulp-rename'),
clean = require('gulp-clean'),
@torgeir
torgeir / org-w3c-dom-serializer.kt
Created Jul 8, 2021
Org w3c dom serializer xml node to string kotlin
View org-w3c-dom-serializer.kt
// 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(..)
@torgeir
torgeir / bigquery-geojson-with-properties.json
Last active Jun 23, 2021
Geojson with properties, extracted from bigquery
View bigquery-geojson-with-properties.json
[
{
"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 ... .\"}}"
}
]
@torgeir
torgeir / fix-monitors.sh
Last active Jun 20, 2021
xrandr config to bring back my display port monitor samsung lc32hg70qquxen on the DQ77kb
View fix-monitors.sh
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 \
@torgeir
torgeir / audio-source-microphone.js
Created Sep 19, 2013
Microphone input as audio source js
View audio-source-microphone.js
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) {