Skip to content

Instantly share code, notes, and snippets.

@vishalbasra
vishalbasra / sleep-runner.sh
Created June 7, 2019 05:45
A sleep runner for macos
# This prevents a macos/osx computer even when the lid is closed to prevent it going to sleep in a multi desktop set-up
# based off https://apple.stackexchange.com/users/9058/nohillside 's answer at https://apple.stackexchange.com/questions/219885/use-caffeinate-to-prevent-sleep-on-lid-close-on-battery
# store in /user/local/bin
#! /bin/bash
BATTERY_SLEEP=5 # in minutes
DEF_WAKE_LEN=32400 # in seconds - I'm on my computer for 9 hours usually
#***** determine timeout value *****
timeout_len=${DEF_WAKE_LEN:-32400} # see also https://unix.stackexchange.com/questions/122845/using-a-b-for-variable-assignment-in-scripts
@vishalbasra
vishalbasra / My Better Coding Guide.md
Last active August 7, 2018 21:28
My guideline of how to write and review code better

Good coding practices or review Guidelines


The goal for this is to make me write better readable code and to also make me a better reviewer


  • Does the brnach name, PR name makes sense?