Skip to content

Instantly share code, notes, and snippets.

View mblsha's full-sized avatar

Michael Pishchagin mblsha

View GitHub Profile
@mblsha
mblsha / CoreAudio.swift
Created August 17, 2020 14:44
Getting/setting volume, balance, mute using CoreAudio (inspired by https://github.com/digital-pers0n/keepQuiet)
import CoreAudio
import AudioToolbox
let defaultDeviceProp = AudioObjectPropertyAddress(
mSelector: kAudioHardwarePropertyDefaultOutputDevice,
mScope: kAudioObjectPropertyScopeGlobal,
mElement: kAudioObjectPropertyElementMaster)
let masterVolumeProp = AudioObjectPropertyAddress(
mSelector: kAudioHardwareServiceDeviceProperty_VirtualMasterVolume,
@mblsha
mblsha / sVim.css
Last active September 8, 2018 11:11
@-webkit-keyframes fadein {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
#sVim-command {
let hintcharacters = "asetniohqwdfurlgykjzxcvmbp"
@mblsha
mblsha / _config.fish
Last active August 29, 2015 14:14
Monitors finished processes in inactive Terminal.app tabs, and activate them by clicking on the notification
# Add these two event hooks to your ~/.config/fish/config.fish
#
# Prerequisites:
# 1. fish 2.1.2. Use "brew upgrade --HEAD fish" to install
# 2. terminal-notifier. Use "brew install terminal-notifier" to install
# 3. Add other files to some directory that's in PATH, and ensure all are marked as executable (chmod +x)
function mbl_preexec --on-event fish_preexec
set -l now (date +%s)
set -g last_exec_timestamp $now
@mblsha
mblsha / extract-itunes-playlist.rb
Created September 22, 2011 15:23
Copies all files from an iTunes playlist to new folder
#!/usr/bin/env ruby -wKU
# PREREQUISITES: sudo gem install rb-appscript
require 'rubygems'
require 'appscript'
require 'fileutils'
require 'pathname'
if ARGV.length != 1