Skip to content

Instantly share code, notes, and snippets.

  • 13th Age
  • A Song of Ice and Fire RPG
  • Abandon All Hope
  • Aces and Eights
  • Albedo
  • Amber
  • Alternity
  • Apocalypse World
  • Arcanis
  • Ars Magica
@kavaliro
kavaliro / GenesysDiceStatistics.linq
Created July 2, 2019 17:17
Script that shows the average amount of result added by a Genesys die. (Genesys RPG)
/*
Calculate the average effect of each die added to a diepool in Genesys.
*/
void Main()
{
var rnd = new Random();
var useRandom = false;
Dictionary<string, Results> results = new Dictionary<string, Results>
{
@kavaliro
kavaliro / OperatingSystemName.ps1
Created February 13, 2017 21:10
Use powershell to get the Operating System name
Get-WmiObject win32_operatingSystem|select -ExpandProperty Caption
@kavaliro
kavaliro / keybase.md
Created July 14, 2015 00:13
Keybase verification

Keybase proof

I hereby claim:

  • I am kavaliro on github.
  • I am jamesdgilmore (https://keybase.io/jamesdgilmore) on keybase.
  • I have a public key whose fingerprint is 6F2F 9868 D249 16BF F60C EA72 27AF 4928 5FE2 2C01

To claim this, I am signing this object:

@kavaliro
kavaliro / RunTimerJob.ps1
Last active August 29, 2015 14:23
Find a Sharepoint Timer Job and run it from PowerShell
#add the powershell snapin for sharepoint. This allows a standard powershell
#console to run sharepoint commands.
if((Get-PSSnapin | Where {$_.Name -eq "Microsoft.SharePoint.PowerShell"}) -eq $null)
{
Add-PSSnapin Microsoft.SharePoint.PowerShell;
}
#Get list of enabled timer jobs
$timers=Get-SPTimerJob|? {$_.isDisabled -eq $false}
#show ordinal and displayname of timer jobs, so the correct job can be run
$gacUtil = "${Env:ProgramFiles(x86)}\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\gacutil.exe";
function Add-GacItem([string]$path) {
#Full Path Name or Relative - ex: C:\Temp\Larned.dll
& $gacutil "/nologo" "/i" "$path"
}
function Remove-GacItem([string]$name) {
@kavaliro
kavaliro / Enable_Powershell-ISE.ps1
Last active August 29, 2015 14:22
Enable Powershell-ISE if it's not already enabled (e.g. Windows Server 2008)
Import-Module ServerManager
Add-WindowsFeature PowerShell-ISE
@kavaliro
kavaliro / SortandSetPath.ps1
Last active July 20, 2021 17:36
A script demonstrating how to sort your path entries via powershell. It's more for show. The last two lines are all that you need to accomplish it. The rest is just how one might get there.
#What's my path?
$env:Path
#How many characters long is my path?
$env:Path.Length
#I want to see each entry separately. I'll save the entries into an array...
$pathEntries = $env:Path.Split(";")
#...and output that array to the commandline.
$pathEntries
#for grins, how many entries in the array?
@kavaliro
kavaliro / Asciidoc_LiveReload_Instructions.adoc
Last active August 29, 2015 14:22
Asciidoc + Livereload instructions and files

Asciidoc plus LiveReload

  1. Install Ruby and the corresponding DevKit, which is lower down the page. Make sure the DevKit matches the Ruby version. Get Ruby here.

  2. Get AsciiDoctor and LiveReload.

    gem install asciidoctor
    gem install guard-livereload guard-shell yajl-ruby