Skip to content

Instantly share code, notes, and snippets.

@stevenirby
stevenirby / cronometer-webhooker.js
Last active July 21, 2021 13:14
Cronometer webhooker - push calories and carbs to webhook.
// ==UserScript==
// @name Cronometer carb and calorie webhooker
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Send net carbs and calories to a webhook.
// @author Steven
// @match https://cronometer.com/
// @grant none
// @run-at document-end
// ==/UserScript==
@stevenirby
stevenirby / turn-off-volume-on-do-not-disturb.sh
Created August 25, 2019 09:05
Mute MacOS when do not disturb is on and you're not using the computer.
#!/bin/bash
#
# Fist check if do not disturb is on.
# Then check if screen is off, meaning you're not using the computer at that time.
# If do not disturb is on and you're not using the machine, mute the volume.
if [[ $(/usr/bin/defaults -currentHost read ~/Library/Preferences/ByHost/com.apple.notificationcenterui doNotDisturb) -eq 1
&& `echo $(/usr/sbin/ioreg -n IODisplayWrangler | grep -i IOPowerManagement | perl -pe 's/^.*DevicePowerState\"=([0-9]+).*$/\1/')/4 | bc` -eq 0 ]];
then
osascript -e "set Volume 0"
(function() {
'use strict';
angular
.module('core')
.directive('valdrAccessibility', valdrAccessibility);
/* @ngInject */
function valdrAccessibility($timeout) {
var directive = {