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
#!/bin/bash | |
## Because Ubuntu 22.10 still has Maven 3.6.3, this fixes it: | |
wget -q https://dlcdn.apache.org/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.tar.gz -P /tmp | |
mkdir ~/sw/ | |
tar xf /tmp/apache-maven-*.tar.gz -C ~/sw/ | |
rm /tmp/apache-maven-*.tar.gz | |
mv /sw/apache-maven-* -C ~/sw/maven | |
echo 'MAVEN_HOME=~/sw/maven' >> ~/.bashrc |
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
FROM ubuntu:22.04 | |
ENV qqy="-qq -y -o=Dpkg::Use-Pty=0" | |
RUN export DEBIAN_FRONTEND=noninteractive \ | |
&& apt-get $qqy update > /dev/null \ | |
&& apt-get $qqy install ca-certificates curl wget gnupg lsb-release > /dev/null \ | |
&& mkdir -p /etc/apt/keyrings \ | |
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg \ |
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
## | |
## This is not a script, rather a sequence of commands to do. | |
## I have tested it and it works. | |
## Use at your own responsibility. | |
## Compiled from https://www.dionysopoulos.me/apple-display-brightness-controls-in-ubuntu-desktop.html | |
## See https://github.com/yhaenggi/acdcontrol.git for more info. | |
## | |
sudo apt-install g++ make | |
git clone https://github.com/yhaenggi/acdcontrol.git |
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
/** | |
* Extracts the first text string in double quotes in the formula of the cell at given address. | |
* @param {"A1"} address Cell address as a string. | |
* @customfunction | |
*/ | |
function getCellLink(address) { | |
if(!(address && typeof(address) == 'string')) | |
throw new Error('The 1st param must be a cell address as a string.'); |
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
object OptionsParsingUtils { | |
private inline fun <reified T : OptionEnum> tryParseEnumOption(enumArgumentDefault: T, arg: String): T? { | |
val optionIntro = "--${enumArgumentDefault.optionName}" | |
if (!arg.startsWith(optionIntro)) | |
return null | |
if (arg.endsWith(optionIntro) || arg.endsWith("=${enumArgumentDefault.optionValue}")) | |
return enumArgumentDefault |
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
package ch.zizka.time | |
import java.time.Duration | |
import java.time.LocalDateTime | |
import java.time.format.DateTimeFormatter | |
import java.time.format.DateTimeParseException | |
import java.time.temporal.ChronoField.DAY_OF_MONTH | |
import java.time.temporal.ChronoField.HOUR_OF_DAY | |
import java.time.temporal.ChronoField.MINUTE_OF_HOUR | |
import java.time.temporal.ChronoField.MONTH_OF_YEAR |
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
#!/bin/bash | |
## Places a branch to a new base. | |
## Useful when splitting a long branch to multiple pull requests. | |
## | |
## ---+--------master | |
## \ | |
## --- A ---- B | |
## | |
## git-moveBranch.sh B from A to master |
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
fun parseCommaDelimitedMap(str: String): Map<String, String> { | |
if (str == null) return null | |
val pairs = str.split(',').map { it.trim() }.filter { it.contains(':') } | |
.map { | |
val parts = it.split(':', limit = 2) | |
Pair(parts[0], parts[1]) | |
} | |
.associate { it } | |
return pairs |
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
##################################################################################################### | |
# | |
# This script creates switches between the versions of various tools, | |
# found in /mnt/jqa/sw/tools/ (curently hard-coded). | |
# | |
# Usage: | |
# $ switch maven 2.1.0 | |
# $ mvn ... | |
# | |
# Installation: |
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
import java.io.FileInputStream; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.io.OutputStreamWriter; | |
import java.nio.charset.StandardCharsets; | |
import java.util.Arrays; | |
import java.util.HashMap; | |
import java.util.HashSet; | |
import java.util.List; |