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
| #!/bin/bash | |
| ## Run this in a directory to fetch all Git repos within it. | |
| find -name .git | sed 's#.git##' | sort | xargs -t -n1 -I % git -C % fetch --all | |
| ## CRON job: You can also put this into `crontab -e` in order to keep all repos up-to-date automatically: | |
| # # m h DoM mth DoW command | |
| # */5 * * * * find /home/ondra/work -name .git | sed 's#.git##' | sort | xargs -t -n1 -I % git -C % fetch --all --tags --force |
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
| private inline fun <reified T : OptionEnum> tryParseEnumOption(enumArgumentDefault: T, arg: String): T? { | |
| val optionIntro = "--${enumArgumentDefault.optionName}" | |
| if (!arg.startsWith(optionIntro)) | |
| return null | |
| if (arg == optionIntro || arg == optionIntro + "=" + enumArgumentDefault.optionValue) | |
| return enumArgumentDefault | |
| val valueStr = arg.substringAfter(optionIntro).removePrefix("=") |
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
| package org.jbake.util | |
| /* | |
| Lazy evaluation of the messages sent to Slf4j. | |
| Usage: | |
| log.trace { "State dump: " + expensiveLongSerialisation(state) } | |
| See also https://jira.qos.ch/browse/SLF4J-371 | |
| */ | |
| import org.slf4j.Logger |
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
| #!/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 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
| 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 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
| ## | |
| ## 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 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
| /** | |
| * 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 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
| 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 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
| 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 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
| #!/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 |