Skip to content

Instantly share code, notes, and snippets.

Avatar

X. Lumi. xunlao

View GitHub Profile
@xunlao
xunlao / launch_app_based_on_environment.sh
Last active Jun 15, 2020
Launch App based on if some website is accessible or not (i.e. in company network or at home)
View launch_app_based_on_environment.sh
# https://stackoverflow.com/questions/22009364/is-there-a-try-catch-command-in-bash
echo "checking the network work/home.."
sleep 5;
{ # try
curl www.vmware.com && { # need to wrap using {}
echo "try pass; open working app"
open "/Applications/Microsoft Outlook.app/"
open "/Applications/Firefox.app/"
}
@xunlao
xunlao / gtimereport_form_filler.js
Created Feb 6, 2017
gtimereport_form_filler.js
View gtimereport_form_filler.js
javascript:(function () {
var date = new Date();
var todayStr = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate();
$("#PeriodStart").val(todayStr);
$("#PeriodEnd").val(todayStr);
/* The items to choose */
$("input")[3].checked = 'checked';
$("input")[4].checked = 'checked';
$("input")[5].checked = 'checked';
$("#ShowSummary")[0].checked = 'checked';