Skip to content

Instantly share code, notes, and snippets.

View mark05e's full-sized avatar

mark05E mark05e

View GitHub Profile
@mark05e
mark05e / callLibraryFunction.gs
Last active December 4, 2022 23:41
Based on function documented on [](https://stackoverflow.com/questions/48928932/call-library-function-from-html-with-google-script-run) with some enhancements for my usecase.
// Function - callLibraryFunction
// based on function documented on
// https://stackoverflow.com/questions/48928932/call-library-function-from-html-with-google-script-run
// with some enhancements for my usecase.
//
function callLibraryFunction(functionPathAndName, ...args){
let fnPathArray = functionPathAndName.split(".");
let fnPathLength = fnPathArray.length
let libFunc = fnPathArray[fnPathArray.length - 1];
# ██████╗ ███████╗███╗ ███╗ ██████╗ ██╗ ██╗███████╗ ██╗ ██╗██████╗
# ██╔══██╗██╔════╝████╗ ████║██╔═══██╗██║ ██║██╔════╝ ██║ ██║██╔══██╗
# ██████╔╝█████╗ ██╔████╔██║██║ ██║██║ ██║█████╗ ███████║██████╔╝
# ██╔══██╗██╔══╝ ██║╚██╔╝██║██║ ██║╚██╗ ██╔╝██╔══╝ ██╔══██║██╔═══╝
# ██║ ██║███████╗██║ ╚═╝ ██║╚██████╔╝ ╚████╔╝ ███████╗ ██║ ██║██║
# ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═══╝ ╚══════╝ ╚═╝ ╚═╝╚═╝
#
# ██████╗ ██╗ ██████╗ █████╗ ████████╗██╗ ██╗ █████╗ ██████╗ ███████╗
# ██╔══██╗██║ ██╔═══██╗██╔══██╗╚══██╔══╝██║ ██║██╔══██╗██╔══██╗██╔════╝
# ██████╔╝██║ ██║ ██║███████║ ██║ ██║ █╗ ██║███████║██████╔╝█████╗
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//ical.marudot.com//iCal Event Maker
CALSCALE:GREGORIAN
BEGIN:VEVENT
DTSTAMP:20221104T170057Z
UID:[email protected]
DTSTART:20221108T083000Z
DTEND:20221108T090000Z
SUMMARY:Arrive
@mark05e
mark05e / find cell by value.gs
Last active November 4, 2022 02:06
Google AppScript - Find cell by value
// original: https://stackoverflow.com/questions/9905533/convert-excel-column-alphabet-e-g-aa-to-number-e-g-25
// updated: https://gist.github.com/mark05e/29bb2b7564460059da6d3e74f08ab31f
function find(value, range) {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = range.split("!")[0];
var A1Ref = range.split("!")[1];
var [cellStart, cellEnd] = A1Ref.split(":")
var rowStartNumber = Number(cellStart.replace(/[^0-9]/g,''))
var rowEndNumber = Number(cellEnd.replace(/[^0-9]/g,''))
@mark05e
mark05e / maskString.ahk
Created October 21, 2022 15:10
Function to return masked string
maskString(inputString){
; Initialize variables
returnString := ""
maxCharacters := 10
; get first 3 char
firstThreeChar := SubStr(inputString, 1, 3)
; get last 3 char
lastThreeChar := SubStr(inputString, -2, 3)

Install Zerotier inside Ubuntu LXC container on Proxmox

Inside Proxmox shell

# Edit VM/LXC Configuration located at /etc/pve/lxc/XXX.conf

echo "lxc.cgroup.devices.allow: c 10:200 rwm" >> /etc/pve/lxc/XXX.conf
echo "lxc.mount.entry: /dev/net dev/net none bind,create=dir" >> /etc/pve/lxc/XXX.conf
; Dial A Number using RingCentral Desktop - mark05e
; ref: https://support.ringcentral.com/app/message/desktop-web/use-keyboard-shortcuts-ringcentral-app.html
; ref: https://www.reddit.com/r/AutoHotkey/comments/s3oxd0/comment/hsmlffe/
; ref: https://gist.github.com/tdalon/84d9caea0368ab0420b81363c2048705
if A_Args[1] = ""
{
NumberToDial := 18337943556 ; https://www.canada.ca/en/environment-climate-change/services/weather-general-tools-resources/telephone-services/recorded-observations-forecasts.html
} else {
NumberToDial := A_Args[1]
@mark05e
mark05e / draw_rectangle.ahk
Created September 30, 2022 10:34
Autohotkey sample to show how to draw a box on screen
; Autohotkey sample to show how to draw a box on screen
; https://www.autohotkey.com/boards/viewtopic.php?t=25520
#Persistent
global border_thickness = 10
global border_color = FF0000
; ctrl + 1
^1::Rect_Draw(100,100,100,100)
return
;
; +-----------------------------------------------------------------------------+
; | AHK Starter Template - mark05e |
; +-----------------------------------------------------------------------------+
; | Change Log: |
; | 1 - Initial Commit |
; +-----------------------------------------------------------------------------+
;
#NoEnv ; Recommended for performance.