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
#!/usr/bin/env bash | |
log() { local LEVEL=$1 MESSAGE=$2 NOW=$(date +%s); printf "%s[%04ds] %s\n" "$LEVEL" "$SECONDS" "$MESSAGE"; } | |
info() { log "$(tput setaf 4)INFO$(tput sgr0)" "$@"; } | |
warn() { log "$(tput setaf 3)WARN$(tput sgr0)" "$@"; } | |
error() { log "$(tput setaf 1)ERROR$(tput sgr0)" "$@"; } | |
if [ "$DEBUG" = "1" ]; then debug() { log "$(tput setaf 5)DEBUG$(tput sgr0)" "$@"; } | |
else debug() { :; }; fi |
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
// Thunderbird auto adopt ICS via filtaquilla | |
function getMessageICSBodyTextFromHdr(msgHdr) { | |
let s = msgHdr.getStringProperty("subject"); | |
if ( s != undefined && s.length != undefined && s.length > 0) { | |
let listener = Components | |
.classes["@mozilla.org/network/sync-stream-listener;1"] | |
.createInstance(Components.interfaces | |
.nsISyncStreamListener); | |
let uri = msgHdr.folder.getUriForMsg(msgHdr); | |
MailServices |
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
# Usage: ./wtgridsplit.ps1 <row> <col> <template-string> <comma-separated-array> | |
# obs.: Requires the wt.exe command to be known to the system via the PATH variable | |
# e.g.: | |
# ./wtgridsplit.ps1 3 3 | |
# ./wtgridsplit.ps1 1 2 "{0}" "cmd /k echo Hello world!,cmd /c ping 127.0.0.1" | |
# ./wtgridsplit.ps1 2 3 "cmd /k echo This is pane {0}!" "A,B,C,D,E" | |
$h = [Int32] $args[0] | |
$w = [Int32] $args[1] | |
$fmts = [String[]] $args[2] |
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
<# Quick set from powershell with: | |
mkdir $HOME/Documents/PowerShell | |
Invoke-WebRequest -URI https://gist.githubusercontent.com/math-queiroz/bfd3f27d669d452ee81255aa479ade62/raw/pwsh-profile.ps1 -OutFile $PROFILE -UserAgent $USERAGENT | |
#> | |
# Set PowerShell to UTF-8 | |
[console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding | |
# PSReadLine | |
Set-PSReadLineOption -BellStyle None |
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 | |
## Discord Webhooks and Perforce Commit Trigger integration shell script | |
## | |
## Usage: | |
## * Make sure the trigger user has proper script execution permissions; | |
## * Make sure the trigger user is logged in p4 server with an unlimited timeout account; | |
## | |
## Use `p4 triggers` command to append the following line to the end of the triggers file (changing the <depot_name>): | |
## global-change change-commit //<depot_name>/... "/p4/1/root/discord_webhook.sh %change%" |