Skip to content

Instantly share code, notes, and snippets.

View amomchilov's full-sized avatar

Alexander Momchilov amomchilov

View GitHub Profile
@amarcu5
amarcu5 / muteonsleep.swift
Last active March 5, 2021 01:35
Small macOS utility to ensure system is muted when asleep to prevent potential sounds during Power Nap; Addresses reddit issue: https://www.reddit.com/r/apple/comments/8t041u/my_macbook_creeps_me_out_by_starting_to_talk_in/
//
// MuteOnSleep
// Ensures system is muted when asleep to prevent potential sounds during Power Nap
//
// Install by pasting the following in a terminal prompt:
// curl https://s3.amazonaws.com/muteonsleep-tool/muteonsleep.tar.gz | tar xvz -C /usr/local/bin/; osascript -e 'tell application "System Events" to make login item at end with properties {path:"/usr/local/bin/muteonsleep", hidden:true}'; nohup /usr/local/bin/muteonsleep &
//
// Uninstall with:
// pkill muteonsleep; osascript -e 'tell application "System Events" to delete login item "muteonsleep"'; rm /usr/local/bin/muteonsleep
//
@detunized
detunized / globals.rb
Created January 16, 2012 12:24
List global Ruby variables and their values
global_variables.sort.each do |name|
puts "#{name}: #{eval "#{name}.inspect"}"
end