Skip to content

Instantly share code, notes, and snippets.

View riseandshinefilms-admin's full-sized avatar

Rise and Shine Films Admin riseandshinefilms-admin

View GitHub Profile
@thomasfinch
thomasfinch / nightShiftControl.sh
Created April 3, 2017 18:40
Bash script to enable/disable night shift on Mac OS
#!/bin/bash
if [ $# -lt 1 ]; then
echo "Usage: $0 [enable|disable]"
exit 1
fi
plistLoc="/private/var/root/Library/Preferences/com.apple.CoreBrightness.plist"
currentUserUID=$(dscl . -read /Users/$(whoami)/ GeneratedUID) # Get the GeneratedUID for the current user
@codeas
codeas / gas2slack_webhook.js
Last active March 16, 2023 11:24
gas2slack by incoming webhook
function START() {
var url = "https://hooks.slack.com/services/xxxxxx/xxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxx";
var payload = {
"channel" : "#test", // <-- optional parameter, use if you want to override default channel
"username" : "robot", // <-- optional parameter, use if you want to override default "robot" name
"text" : "It's working", // <-- required parameter
"icon_emoji": ":robot_face:", // <-- optional parameter, use if you want to override default icon,
//"icon_url" : "http://image" // <-- optional parameter, use if you want to override default icon
#!/bin/bash
LOCALADMIN="username"
kickstart=/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart
echo "Configuring Remote Management"
if id -u $LOCALADMIN >/dev/null 2>&1; then
echo "Defined local admin account exists"
# Deactivate ARD agent, deny all access
echo "Deactivating ARD agent"
@mogsdad
mogsdad / drivingDistance.gs
Last active December 29, 2021 20:52
drivingDistance() is a Google Sheets custom function that calculates the driving distance along a possibly multi-point route.
/**
* Calculate the driving distance (in meters) along a route.
*
* @param {"london","manchester","liverpool"} route
* Comma separated ordered list of two or more map
* waypoints to include in route. First point
* is 'origin', last is 'destination'.
*
* @customfunction
*/
@daffl
daffl / expression.pegjs
Last active July 25, 2018 10:31
An expression grammar for PEGJS
start = (text / enclosedexpression)*
text =
characters:$((!open) c:any)+ {
return {
type: 'text',
value: characters
}
}