Skip to content

Instantly share code, notes, and snippets.

View tillig's full-sized avatar

Travis Illig tillig

View GitHub Profile
@tillig
tillig / word.css
Created August 30, 2017 17:42
Simple Word CSS
<style type="text/css">
<!--
body
{
font-family: Calibri;
background-color: white;
color: black;
font-size: 11pt;
padding-left: 10pt;
padding-right: 10pt;
@tillig
tillig / FormatConfigFiles.proj
Created April 13, 2017 18:11
Format XML configuration files on build with tidy
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="All" InitialTargets="_SetVersion" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<Import Project="$(MSBuildProjectDirectory)\toolset\msbuildcommunitytasks\MSBuild.Community.Tasks.Targets"/>
<Target Name="_Tidy">
<ItemGroup>
<ConfigFiles
Include="$(MSBuildProjectDirectory)\**\*.config"
Exclude="$(MSBuildProjectDirectory)\packages\**\*.*;
$(MSBuildProjectDirectory)\**\packages.config;
$(MSBuildProjectDirectory)\**\NuGet.config;
@tillig
tillig / Set-SemanticQualfier.ps1
Created April 13, 2017 18:01
Use semantic versioning in TeamCity builds (master vs. develop)
# Run this in a build step and the %teamcity.build.branch.is_default%
# gets subbed in with "True" or "False"
if(-not $%teamcity.build.branch.is_default%)
{
Write-Host "##teamcity[setParameter name='env.SemanticQualifier' value='-beta{0}']"
}
@tillig
tillig / Find-SdMovies.ps1
Created April 13, 2017 00:04
Find SD movies in a file location
$fileLocation = "\\diskstation\video\Movies\"
# This is the CLI version of MediaInfo
# https://mediaarea.net/en/MediaInfo
$mediaInfoLocation = "C:\util\MediaInfo.exe"
Get-ChildItem $fileLocation -Filter *.m4v -Recurse | %{
$path = $_.FullName
[xml]$info = & $mediaInfoLocation --Output=XML "$path"
$video = $info.Mediainfo.File.track | Where-Object { $_.type -eq "Video" }
$width = [int]$video.Width.Replace(" pixels", "").Replace(" ", "")
@tillig
tillig / Sort-PictureFiles.ps1
Created March 29, 2017 00:08
Calculate which files from a camera source have been backed up and which need to be filed, then sort all files appropriately
<#
.Synopsis
Sorts picture files from camera sources into appropriate
folders for filing.
.DESCRIPTION
Compares the set of pictures in the camera source folder
and the backup folder, then merges/sorts the contents into
a third location based on how they need to be filed.
Items get sorted into one of four groups:
@tillig
tillig / README.md
Created March 16, 2017 21:45
Truncate Git repo history, back-date initial commit, push to new repo
  1. Check out the branch you want to truncate.
  2. Get the SHA1 hash of the commit in that branch you want to start history.
  3. truncate.sh SHA1 branchname like truncate.sh 01cea49c9cbefd696bbd54ee41b47cbf1b6d1bd5 master
  4. Get the SHA1 hash of the new base commit.
  5. Get the date you want that commit to have in the format like Sat, 14 Dec 2013 12:40:00 -0800
  6. fixdate.sh SHA1 "date" like fixdate.sh c776e91dd573053ec09ecb1b0737909f9aacd0c9 "Sat, 14 Dec 2013 12:40:00 -0800"
  7. Add a remote to the new repo.
  8. Push the updated branch to the remote.
@tillig
tillig / user_presets.json
Last active November 13, 2023 18:47
Presets for Handbrake conversion
{
"PresetList": [
{
"ChildrenArray": [
{
"AlignAVStart": false,
"AudioCopyMask": [
"copy:aac",
"copy:ac3",
"copy:dtshd",
@tillig
tillig / user_presets.xml
Last active January 22, 2017 00:00
Presets for Handbrake conversion - Handbrake 0.10.x
<?xml version="1.0"?>
<ArrayOfPreset xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Preset>
<Category>User Presets</Category>
<Description />
<IsBuildIn>false</IsBuildIn>
<IsDefault>false</IsDefault>
<Name>Illig High Profile - SD Film</Name>
<PictureSettingsMode>Custom</PictureSettingsMode>
<UseDeinterlace>false</UseDeinterlace>
@tillig
tillig / HandbrakeQueueReport.ps1
Created January 7, 2017 21:20
Report to query the Handbrake queue and dump a local copy of the current status (sync the report via OneDrive for remote access to queue status)
$reportFile = ".\QueueStatus.txt"
$handbrakeDir = Join-Path ([Environment]::GetFolderPath("ApplicationData")) -ChildPath "Handbrake"
[XML]$queue = Get-ChildItem -Path $handbrakeDir -Filter "hb_queue*.xml" |
Sort-Object -Property LastWriteTime -Descending |
Select-Object -First 1 |
Get-Content
$queue.ArrayOfQueueTask.QueueTask |
Select-Object -Property @{n='Status';e={$_.Status}},@{n='Source';e={$_.Task.Source}},@{n='Destination';e={$_.Task.Destination}} |
@tillig
tillig / ResetBestAppearance.au3
Created January 7, 2017 21:15
AutoIt3 script for setting best appearance on Windows Server 2008 R2
#RequireAdmin
; AutoIt3 script for setting best appearance on Win2K8R2
; Used when drop shadows on icons, etc. disappear for unknown reason.
ShellExecute("sysdm.cpl")
WinWaitActive("System Properties")
ControlCommand("System Properties", "", 12320, "TabRight", "")
;For some reason it used to be two tabs right, now it's just one.
;ControlCommand("System Properties", "", 12320, "TabRight", "")
Send("!s")
WinWaitActive("Performance Options")