Skip to content

Instantly share code, notes, and snippets.

View brianpeiris's full-sized avatar

Brian Peiris brianpeiris

View GitHub Profile
Hotkey, F8, EarlyTerm ; Quick kill command. Hit PAUSE key at any time on the keyboard to kill the script
Loop ;This is the loop. When you run this script, AHK will set the volume at desired level then wait .5 seconds then will repeat forever until you press the PAUSE key, which will kill the script.
{
SoundSet, 100, MASTER, VOLUME, 3
Sleep, 200
}
; SoundSet = AHK Command; MASTER = ComponentType; VOLUME = ControlType (This is the volume you are setting the mic at); 6 = DeviceNumber ; DeviceNumber will vary from system to system. Please run the soundcard analysis script to find out what the DeviceNumber of your microphone is. This script can be found in the AHK help here: https://autohotkey.com/docs/commands/SoundSet.htm#Ex . The soundcard analysis script is not very descriptive, so a good way to glean the information you require is to set the volume of the mic you are interested to something wierd, like 57, from within the Windows recording devices Properties interface. Then, run the soundcard analysis s
@brianpeiris
brianpeiris / findrefs.sh
Created September 8, 2016 04:23 — forked from jaburns/findrefs.sh
Find scene and prefab references to scripts in Unity.
#!/usr/bin/env bash
#
# Run from the project root. Pass the full name of a script, or substring of the names of the scripts to check.
#
# Example
# $) ./findrefs.sh BackgroundCamera
# Finding matches for script Assets/Scripts/Camera/BackgroundCamera.cs.meta ...
# Assets/Prefabs/CaveBGCamera.prefab: m_Script: {fileID: 11500000, guid: 7e63acfee367c4314852b87218149bd3, type: 3}
# Assets/Prefabs/ForestBGCamera.prefab: m_Script: {fileID: 11500000, guid: 7e63acfee367c4314852b87218149bd3, type: 3}
#
<snippet>
<content><![CDATA[
import ipdb; ipdb.set_trace()
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- <tabTrigger>hello</tabTrigger> -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
<tabTrigger>ipdb</tabTrigger>
<scope>source.python</scope>
@brianpeiris
brianpeiris / gist:5359550
Last active December 16, 2015 02:00 — forked from amkaos/gist:5357240
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
param ([string] $Path = (Get-Location))
function Get-MD5 (
[System.IO.FileInfo]
$file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]')
) {
# This Get-MD5 function sourced from:
# http://blogs.msdn.com/powershell/archive/2006/04/25/583225.aspx
$stream = $null
$hashAlgorithm = New-Object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider
@brianpeiris
brianpeiris / gist:211909
Created October 16, 2009 17:41 — forked from danwrong/gist:175591
A serializeHash plugin for jQuery that allows you to submit a form using jQuery's ajax functions.
/***
The serializeHash method can be used to submit forms with an ajax request.
The result of serializeHash can be used as the 'data' option for jQuery's
built-in ajax methods and functions.
***/
(function($){
$.fn.serializeHash = function() {
var hash = {};
/***
Use serializeArray() to get an array of JSON objects for