Skip to content

Instantly share code, notes, and snippets.

View matthewoestreich's full-sized avatar
♠️
👋

Matt Oestreich matthewoestreich

♠️
👋
View GitHub Profile
@matthewoestreich
matthewoestreich / clear.dns.cache.sh
Last active October 12, 2019 19:24
Clears DNS Cache on Mac
#!/bin/bash
# HOW TO USE:
# bash clear.dns.cache.sh
dscacheutil -flushcache
sudo killall -HUP mDNSResponder
say cleared dns cache
@matthewoestreich
matthewoestreich / ConvertFileto-Base64.ps1
Created October 29, 2019 15:59
Good for converting .dll files into Base64 strings, in order to embed .dll files into scripts. This allows you to either export the .dll to disk, or attempt to run from memory.
function ConvertFileTo-Base64 {
param(
[Parameter(Mandatory=$true)]
[string] $SourceFilePath,
[Parameter(Mandatory=$true)]
[string] $TargetFilePath
)
$SourceFilePath = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($SourceFilePath)
spec:
template:
spec:
serviceAccountName: jenkins-master
@matthewoestreich
matthewoestreich / Add-JsonToTreeView.ps1
Last active November 3, 2019 04:57
Add JSON data to TreeView Component [System.Windows.Forms.TreeView]
function Add-JsonToTreeview {
########################################################################################
# #
# The MIT License #
# #
# Copyright (c) 2019 Matt Oestreich. http://mattoestreich.com #
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy #
# of this software and associated documentation files (the "Software"), to deal #
@matthewoestreich
matthewoestreich / Add-JsonToTreeView_Demo.ps1
Last active November 3, 2019 00:52
Add-JsonToTreeView Source Code For Demo
function Show-jsonTreeView_psf {
#----------------------------------------------
#region Import the Assemblies
#----------------------------------------------
[void][reflection.assembly]::Load('System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a')
[void][reflection.assembly]::Load('System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089')
#endregion Import Assemblies
#----------------------------------------------
@matthewoestreich
matthewoestreich / Show-JsonTreeView.ps1
Created November 7, 2019 02:10
Displays JSON Data in TreeView
function Show-JsonTreeView {
param (
[Parameter(Mandatory)]
$Json
)
function Show-jsonTreeView_psf {
#----------------------------------------------
import linecache
import sys
def GetExceptionInfo():
"""
Gets detailed exception info.
------------------------------------------
~~ :EXAMPLE: ~~
!function(e){var t={};function n(i){if(t[i])return t[i].exports;var a=t[i]={i:i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(i,a,function(t){return e[t]}.bind(null,a));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";n.r(t);var i={hooks:{},extensions:[],wrappers:[],navbar:{add:!0,sticky:!0,title:"Me
/*!
* mmenu.js
* mmenujs.com
*
* Copyright (c) Fred Heusschen
* frebsite.nl
*
* License: CC-BY-NC-4.0
* http://creativecommons.org/licenses/by-nc/4.0/
*/.mm-menu_theme-white{--mm-color-border:rgba( 0,0,0, 0.1 );--mm-color-button:rgba( 0,0,0, 0.3 );--mm-color-text:rgba( 0,0,0, 0.7 );--mm-color-text-dimmed:rgba( 0,0,0, 0.3 );--mm-color-background:#fff;--mm-color-background-highlight:rgba( 0,0,0, 0.06 );--mm-color-background-emphasis:rgba( 0,0,0, 0.03 );--mm-shadow:0 0 10px rgba( 0,0,0, 0.2 )}.mm-menu_theme-dark{--mm-color-border:rgba( 0,0,0, 0.3 );--mm-color-button:rgba( 255,255,255, 0.4 );--mm-color-text:rgba( 255,255,255, 0.85 );--mm-color-text-dimmed:rgba( 255,255,255, 0.4 );--mm-color-background:#333;--mm-color-background-highlight:rgba( 255,255,255, 0.08 );--mm-color-background-emphasis:rgba( 0,0,0, 0.1 );--mm-shadow:0 0 20px rgba( 0,0,0, 0.5 )}.mm-menu_theme-black{--mm-color-border:rgba( 255,255,255, 0.25 );--mm-color-button:rgba( 255,255,255, 0.4 );--mm-color-text:rgba( 255,255,255, 0.75 );--mm-
@matthewoestreich
matthewoestreich / youtube_iframe_api_jquery_poc.html
Created January 28, 2020 20:50
messin' around with the youtube iframe api w/ jquery
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Custom YouTube Controls</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
</head>
<body>