Skip to content

Instantly share code, notes, and snippets.

View Jaykul's full-sized avatar
😀
Learning

Joel Bennett Jaykul

😀
Learning
View GitHub Profile
@Jaykul
Jaykul / Breaking.Types.ps1xml
Last active April 25, 2016 21:20
Breaking PowerShell since ... *muffled sounds*
<!-- This breaks ConvertTo-JSON for strings -->
<Types>
<Type>
<Name>System.String</Name>
<Members>
<ScriptProperty>
<Name>AsBase64</Name>
<GetScriptBlock>
[System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($this))
</GetScriptBlock>
@Jaykul
Jaykul / DotNetCore.user.js
Created May 17, 2016 19:28
Fix DotNet Core Docs
// ==UserScript==
// @name Wide DotNet Core Docs
// @namespace http://HuddledMasses.org
// @description Fix the sidebar on .net core reference so you can read everything.
// @include */dotnet.github.io/api/*
// @version 1.1
// @grant none
// ==/UserScript==
var styleSheet = "" +
@Jaykul
Jaykul / PowerShell-Malmo-0.ps1
Last active July 13, 2016 16:14
Driving Minecraft from PowerShell
#requires -version 5.0
using assembly MalmoNet.dll
using namespace Microsoft.Research.Malmo
[Environment]::CurrentDirectory = $PSScriptRoot
$ErrorActionPreference = "Stop"
$agentHost = [AgentHost]::new()
$mission =[MissionSpec]::new()
$missionRecord = [MissionRecordSpec]::new("$PSScriptRoot\saved_data.tgz")
@Jaykul
Jaykul / Crash.ps1
Last active December 13, 2016 23:21
Because Pranks
Add-Type -As PresentationFramework; $Window = [System.Windows.Window]@{ Background="Transparent"; AllowsTransparency="True"; WindowStyle="None"; Width=1920; Height=1080; ShowActivated=$true; TopMost=$True; WindowState="Maximized"; Content = ([System.Windows.Controls.Image]@{ Source = 'http://i.imgur.com/IGMwt.jpg'; Stretch="Fill" }) }; $Window.Add_MouseEnter({Sleep 3; $this.Close();}); $Window.Add_Loaded({ $player = [Windows.Media.MediaPlayer]::new(); $player.Open([Uri]"http://soundbible.com/grab.php?id=1765&type=mp3"); $player.Play(); }); $Window.ShowDialog()
param($IPAddress)
Set-DnsClientServerAddress -InterfaceIndex ((Get-NetAdapter).ifIndex) -ServerAddresses $IPAddress
@Jaykul
Jaykul / Set-Volume.ps1
Created July 19, 2016 18:00
Playing With Volume...
Add-Type -Path C:\Users\JBennett\Source\Repos\SoundUtils\SoundUtils\SoundUtils.cs
$volume = [WOSI.Utilities.EndpointVolume]::new()
$volume | gm
foreach($channel in 0..($volume.GetChannelCount()-1)) {
[PSCustomObject]@{Channel = $channel; Volume = $volume.GetChannelVolume($channel) }
}
$volume.SetChannelVolume(0, 0.5)
@Jaykul
Jaykul / CombineFiles.xml
Last active January 10, 2017 23:18
Thinking about MSBuild for PowerShell
<Target Name="CombineFiles">
<CreateItem Include=".\**\*.ps1">
<Output TaskParameter="Include" ItemName="ScriptsToCombine" />
</CreateItem>
<ReadLinesFromFile File="%(ScriptsToCombine.FullPath)">
<Output TaskParameter="Lines" ItemName="ScriptLines" />
</ReadLinesFromFile>
<WriteLinesToFile File="output.psm1" Lines="@(ScriptLines)" Overwrite="true" />
@Jaykul
Jaykul / TestScript.ps1
Last active February 4, 2017 02:10
Repro case for Type Problem
#requires -Module TypeTest
using module TypeTest
invoke-command { Set-Key $args } -args (Get-Key) -ComputerName .
@Jaykul
Jaykul / keybase.md
Created February 10, 2017 04:44
keybase.md

Keybase proof

I hereby claim:

  • I am jaykul on github.
  • I am jaykul (https://keybase.io/jaykul) on keybase.
  • I have a public key ASDJmF0xizurDXD1Tphu2Hvw-Pwb2ygs2ArOmeVOQ3Kq8Ao

To claim this, I am signing this object:

@Jaykul
Jaykul / BlockChain Verification
Created January 5, 2016 20:58
BlockChain Verification
Verifying that +jaykul is my blockchain ID. https://onename.com/jaykul