Skip to content

Instantly share code, notes, and snippets.

@bmccormack
bmccormack / churnQueue.ps1
Created February 21, 2012 15:55
Churn through the Kiln Queue with restarts
function get-queueLength(){
try {
$s = (New-Object net.webclient).DownloadString('http://localhost:56785/stats.json')
}
catch {
return "queue length unavailable"
}
$queueLength = $s -split (',') | foreach{if ($_ | select-string "queueLength" -quiet){ ($_ -split ":")[1]}}
return $queueLength
}
@bmccormack
bmccormack / Select-WindowStarted.ps1
Created May 3, 2012 15:18
Select-WindowStarted
# Uses WASP from http://wasp.codeplex.com for automating the control of Windows in Powershell.
# The purpose of this function is to start a new process and then return the window
# that was opened by the started process. This can be difficult because if you already have
# multiple windows open for that process; there may be a delay in the window being returned
# after the process is started; and the process that is started is not always the same as the
# window that's created (Chrome).
#
# This function will grab a list of current windows matching the processName, start a new instance,
# and will then loop until the new window is opened or the function times out. example:
#
@bmccormack
bmccormack / skipFogBugz.ps1
Created August 7, 2012 15:35
Skip FogBugz Installation in Kiln Setup
#Renames FogBugz installer and replaces it with Notepad.
#Copy the following into a Powershell console.
ren $env:appdata\kilninstaller\FogBugz-Setup.exe $env:appdata\kilninstaller\FogBugz-Setup.exe.bak;
copy $env:systemRoot\Notepad.exe $env:appdata\kilninstaller\FogBugz-Setup.exe
@bmccormack
bmccormack / statusSteps.css
Created September 18, 2012 17:18
FogBugz Workflow Bugmonkey
#BugBreadcrumbs .breadcrumbs {
overflow: hidden;
margin-left: -2px;
}
#BugBreadcrumbs .breadcrumbs li {
float: left;
padding: 5px 0 5px 30px;
background: #eee;
color: #999;
position: relative;
@bmccormack
bmccormack / readme.md
Last active April 2, 2021 04:30
Trello: show label names on the front of cards
@bmccormack
bmccormack / readme.md
Last active August 29, 2015 14:13
Subscribe to conversations in Help Scout

##Introduction

Have you ever wanted to subscribe to conversations in Help Scout? With Help Scout webhooks and webscript.io, now you can! Just add subscribed-yourname as a tag to a conversation (where yourname is the first part of your company email address), and you'll get emailed when a change comes in.

##Set up

  1. Make a webscript.io account. It's free to test.
  2. In webscript.io, make a new script. Copy in the code from the_code.lua (below) in this gist and paste it into the script.
    • Be sure to change the variables at the top.
  • If you need an SMTP server, you can get one from Mandrill in seconds (free accounts can send up to 12K emails per month, so you'll be fine).

#Random Assignment for Help Scout

When you have conversations that are handled by multiple individuals on a team, it can be difficult to distribute the tasks evenly to each member without cherry picking or having someone manage the queue.

This script helps by taking unassigned conversations and re-assigning them randomly to the members of the team, based on a specified weight.

@bmccormack
bmccormack / help_scout_hide_negative_satisfaction_ratings.user.js
Created February 3, 2015 18:52
Hide Not Good and Okay satisfaction ratings in Help Scout conversations.
// ==UserScript==
// @name Help Scout - Hide Negative Satisfaction Ratings
// @namespace https://secure.helpscout.net
// @include https://secure.helpscout.net/*
// @description Hides Not Good and Okay satisfaction ratings within conversations
// @author Ben McCormack
// @version 1.0.0.0
// ==/UserScript==
@bmccormack
bmccormack / help_scout_docs_edit_links.user.js
Created February 4, 2015 19:41
Add "Edit this article" links to Help Scout docs. You need to edit the docsID value first.
@bmccormack
bmccormack / movingAvg.c
Created March 31, 2015 01:05
Moving average example in C
#include <stdio.h>
int movingAvg(int *ptrArrNumbers, long *ptrSum, int pos, int len, int nextNum)
{
//Subtract the oldest number from the prev sum, add the new number
*ptrSum = *ptrSum - ptrArrNumbers[pos] + nextNum;
//Assign the nextNum to the position in the array
ptrArrNumbers[pos] = nextNum;
//return the average
return *ptrSum / len;