Skip to content

Instantly share code, notes, and snippets.

View peteromano's full-sized avatar

Peter C. Romano peteromano

View GitHub Profile
@peteromano
peteromano / mute.ps1
Created August 27, 2019 19:03
This script toggles muting the default audio input device (microphone), resets the input volume to 100% (when unmuted), and presents a tooltip balloon indicating mute status. Scripted for Windows 10, and primarily used with the Elgato Stream Deck (set as System script.)
Add-Type -TypeDefinition @'
using System.Runtime.InteropServices;
[Guid("5CDF2C82-841E-4546-9722-0CF74078229A"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
interface IAudioEndpointVolume {
// f(), g(), ... are unused COM method slots. Define these if you care
int f(); int g(); int h(); int i();
int SetMasterVolumeLevelScalar(float fLevel, System.Guid pguidEventContext);
int j();
int GetMasterVolumeLevelScalar(out float pfLevel);
@peteromano
peteromano / Product.model.js
Last active January 14, 2018 16:45
Sequelize Model Class Definitions
import {parse, define, Model, DataTypes} from './Sequelize';
/**
* Decorator for creating Sequelize model definition
*
* - `parse(__filename)` extracts the name of the current file (without extension.)
* - `@define('MyProduct')` would define the model as `MyProduct`.
*/
@define(parse(__filename))
@peteromano
peteromano / gist:6768763
Created September 30, 2013 19:22
Adds target attribute binding as 'linkToNewTab' helper
// Extend Ember.LinkView to support target attribute binding
var NewTabLinkView = Ember.LinkView.extend({
// Bind target attribute to view
//attributeBindings: Ember.LinkView.prototype.attributeBindings.concat('target'),
attributeBindings: ['href', 'title', 'target'],
// Set target attribute to '_blank' by default
target: '_blank',
// Since we are navigating to a new browser instance (bypassing router), we can
// just let browser do its default thing
_invoke: function() {