:w !sudo tee %
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
require "string" | |
function checkBluetoothResult(rc, stderr, stderr) | |
if rc ~= 0 then | |
print(string.format("Unexpected result executing `blueutil`: rc=%d stderr=%s stdout=%s", rc, stderr, stdout)) | |
end | |
end | |
function bluetooth(power) | |
print("Setting bluetooth to " .. power) |
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
require(tidyverse) | |
# Set timezone to Central European Time | |
Sys.setenv(TZ='CET') | |
# The prefix to load the data from the web | |
stub <- "https://www.volksgezondheidenzorg.info/sites/default/files/map/detail_data/klik_corona" | |
# Day statistics are normally published before 4:30 | |
upTime <- |
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
[2019-04-29 22:10:04] [DEBUG] web: JSON api request: '/api/player' | |
[2019-04-29 22:10:04] [DEBUG] httpd: Checking web interface authentication | |
[2019-04-29 22:10:04] [DEBUG] httpd: Authentication successful | |
[2019-04-29 22:10:04] [DEBUG] player: Player status: playing | |
[2019-04-29 22:10:06] [DEBUG] raop: Got retransmit request from 'myPod', seq_start 16757 len 1 | |
[2019-04-29 22:10:06] [DEBUG] raop: Got retransmit request from 'myPod', seq_start 16816 len 1 | |
[2019-04-29 22:10:10] [DEBUG] raop: Got retransmit request from 'myPod', seq_start 17336 len 1 | |
. | |
. | |
. |
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
[2019-11-10 17:59:29] [DEBUG] player: Start playback of '/media/music/Mark Knopfler/Down the Road Wherever (2018) [CD]/14 Every Heart in the Room.m4a' (id=29562, item-id=1667) | |
[2019-11-10 17:59:29] [DEBUG] db: Running query 'SELECT f.* FROM files f WHERE f.id = 29562;' | |
[2019-11-10 17:59:29] [DEBUG] player: (Re)opening track: '/media/music/Mark Knopfler/Down the Road Wherever (2018) [CD]/14 Every Heart in the Room.m4a' (id=1667, seek=0) | |
[2019-11-10 17:59:29] [DEBUG] db: Running query 'BEGIN TRANSACTION;' | |
[2019-11-10 17:59:29] [DEBUG] db: Starting enum 'SELECT * FROM queue f WHERE id = 1667 ORDER BY pos;' | |
[2019-11-10 17:59:29] [DEBUG] db: Running query 'END TRANSACTION;' | |
[2019-11-10 17:59:29] [DEBUG] player: Setting up input item '/media/music/Mark Knopfler/Down the Road Wherever (2018) [CD]/14 Every Heart in the Room.m4a' (item id 1667) | |
[2019-11-10 17:59:30] [DEBUG] ffmpeg: Unhandled or malformed custom metadata of size 64 | |
[2019-11-10 17:59:30] [DEBUG] ffmpeg: Unhandled or mal |
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
kill-line() { zle .kill-line ; echo -n $CUTBUFFER | clipcopy } | |
zle -N kill-line | |
bindkey "^K" kill-line | |
kill-whole-line() { zle .kill-whole-line ; echo -n $CUTBUFFER | clipcopy } | |
zle -N kill-whole-line | |
bindkey "^U" kill-whole-line | |
yank() { LBUFFER=$LBUFFER$(clippaste) } | |
zle -N yank |
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
Encoding.default_external='utf-8' | |
Encoding.default_internal='utf-8' | |
require 'anystyle/parser' | |
require 'clipboard' | |
text = Clipboard.paste.tr("\n\r", " ").gsub(/\s+/,' ').gsub(/([a-zA-Z])- ([a-zA-Z])/, '\1\2') | |
ref = Anystyle.parse(text, :bibtex).to_s | |
Clipboard.copy(ref) |
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 ruby | |
# Copyright 2017 Mahmood S. Zargar | |
# Author: [email protected] (Mahmood S. Zargar) | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 |
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 groups = []; | |
document.querySelectorAll("li.group").forEach( | |
function(group) { | |
name = group.querySelector("span.group-name").textContent; | |
members = []; | |
group.querySelectorAll("div.group-user-name").forEach( | |
function(member) { | |
members.push(member.textContent.trim() + "\t" + name); | |
} | |
); |
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
# The functions below use parallelized versions of gzip, xz, and bzip2 to | |
# improve compression/decompression performance of RDS serialization in R. | |
# Each function searches for the appropriate program (based on the required | |
# compression format) and if found, offloads the compression handling to the | |
# external program and therefore leaves R free to do the data import/export. | |
# The two main functions (saveRDS and readRDS) mask R's native read and write | |
# functions. The functions have been only tested on macOS, but they must work | |
# on any Linux/Unix. | |
# | |
# Requires the following packages: pxz, pbzip2, and pigz. |
NewerOlder