Skip to content

Instantly share code, notes, and snippets.

View bpruitt-goddard's full-sized avatar

Brian Pruitt-Goddard bpruitt-goddard

View GitHub Profile
@bpruitt-goddard
bpruitt-goddard / gist:5808322
Last active December 18, 2015 15:59
ServiceStack PR 736
public class CustomRequiredPermissionAttribute : RequestFilterAttribute, IApiResponseAttribute
{
public List<string> RequiredPermissions { get; set; }
private string permissionsDesc
{
get
{
return "Required Permissions: {0}".FormatUsing(string.Join(",", RequiredPermissions));
}
}
@bpruitt-goddard
bpruitt-goddard / Backup-VMs.ps1
Created October 6, 2014 03:56
Export Hyper-V VMs (Powershell)
# Directions for use:
# Import this script using the Import-Module cmdlet
# On PoshCode at http://poshcode.org/5486 (modified from the original http://poshcode.org/3927)
# All output is logged to the backup directory in the $($BackupDriveLetter):\VMBackup\Backup-VMs.log file
# Use the Backup-VMs cmdlet to begin the process
# Parameter BackupDriveLetter indicates the drive to put this backup onto. It must be mounted to the host running the script.
# Parameter VMHost defines the host that contains the VMs you want to back up. If it's blank, then it just targets the host the script is running on
# Parameter VMNames defines the specific VMs you wish to backup, otherwise it'll back up all of them on the target host
# Switch parameter ShutHostDownWhenFinished will cause the specified host (and any VMs running on it) to shut down upon completion of the backup
# Example:
@bpruitt-goddard
bpruitt-goddard / datascrubber.py
Created June 20, 2015 22:49
GameTracker Data Scrubber
"""
datascrubber.py
Quick and dirty script to pull the data from google spreadsheet into the GameTracker database
Inserts players (manually identified), games, and all sessions
"""
import csv
import sys
import itertools
from collections import defaultdict
@bpruitt-goddard
bpruitt-goddard / GreaseMonkeyScript.js
Created November 20, 2015 23:28
VersionOne Backlog Defect Copy GreaseMonkey Script
// ==UserScript==
// @name V1 Copy Trello Template Board
// @namespace Anamespace
// @include https://www8.v1host.com/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js
// @require http://courses.ischool.berkeley.edu/i290-4/f09/resources/gm_jq_xhr.js
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// @require https://api.trello.com/1/client.js?key=368dd97b50bf7c0f425deae164ff4384
// @require https://raw.githubusercontent.com/alexei/sprintf.js/master/dist/sprintf.min.js
// @version 1
@bpruitt-goddard
bpruitt-goddard / BGG Rank Voice Tasker Profile.prf.xml
Created April 30, 2016 03:14
Tasker profile for speaking the BoardGameGeek rank for a game. The command is "BGG rank <game name>".
<TaskerData dvi="1" sr="" tv="4.8u1m">
<Profile sr="prof3" ve="2">
<cdate>1460962844383</cdate>
<edate>1461822396172</edate>
<id>3</id>
<mid0>2</mid0>
<nme>BGG Voice Rank</nme>
<State sr="con0" ve="2">
<code>20126</code>
<Bundle sr="arg0">
@bpruitt-goddard
bpruitt-goddard / UnitTest.cs
Created November 28, 2018 20:29
SemanticComparison Unit Test Example
public class SemanticTests
{
public class Foo
{
public int Bar { get; set; }
public string Baz { get; set; }
}
public class FooDto
{
@bpruitt-goddard
bpruitt-goddard / GreaseMonkeyScript.js
Created January 23, 2019 19:26
Greasemonkey Hide Uberconference Mute Messages
// ==UserScript==
// @name UberConference Hide Mutes
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Hide the mute and unmute notifications that flood the chat
// @author Brian Pruitt-Goddard
// @match https://www.uberconference.com/*
// @grant none
// @require https://raw.githubusercontent.com/uzairfarooq/arrive/master/minified/arrive.min.js
// ==/UserScript==
@bpruitt-goddard
bpruitt-goddard / insert_games.sql
Last active May 1, 2019 18:27
Seed Lists For Game Tracker
INSERT INTO public.games (Name, bgg_id, game_type, created_at, updated_at) VALUES ('5 Tribes', 157354, 'competitive', NOW(), NOW());
INSERT INTO public.games (Name, bgg_id, game_type, created_at, updated_at) VALUES ('7 Wonders', null, 'competitive', NOW(), NOW());
INSERT INTO public.games (Name, bgg_id, game_type, created_at, updated_at) VALUES ('7 Wonders Duel', null, 'competitive', NOW(), NOW());
INSERT INTO public.games (Name, bgg_id, game_type, created_at, updated_at) VALUES ('7th Continent', null, 'cooperative', NOW(), NOW());
INSERT INTO public.games (Name, bgg_id, game_type, created_at, updated_at) VALUES ('A Touch of Evil: the Supernatural Game', 35815, 'mixed', NOW(), NOW());
INSERT INTO public.games (Name, bgg_id, game_type, created_at, updated_at) VALUES ('Agricola', null, 'competitive ', NOW(), NOW());
INSERT INTO public.games (Name, bgg_id, game_type, created_at, updated_at) VALUES ('Alchemists', null, 'competitive ', NOW(), NOW());
INSERT INTO public.games (Name, bgg_id, game_type, created_at, u
@bpruitt-goddard
bpruitt-goddard / GreaseMonkeyScript.js
Created April 26, 2019 17:16
GreaseMonkey Show File Ids In CF Search Cards
// ==UserScript==
// @name CF Show FileIds In Search
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Show FAST File Id In search results
// @author Brian Pruitt-Goddard
// @match https://dev.ncwp.firstam.net/search/*
// @grant none
// @require https://raw.githubusercontent.com/uzairfarooq/arrive/master/minified/arrive.min.js
// ==/UserScript==
@bpruitt-goddard
bpruitt-goddard / mockIrisImport.js
Created April 29, 2019 18:16
Mock Iris For LD File Import
const http = require('http');
const hostname = '127.0.0.1';
const port = 54499;
const server = http.createServer((req, res) => {
// GET is for retrieving file index
if (req.method === 'GET')
{
res.statusCode = 404;