Skip to content

Instantly share code, notes, and snippets.

@OnceUponALoop
OnceUponALoop / profile.ps1
Last active April 9, 2021 21:12
Set colors of powershell console to indicate administrative mode
#--------------------------------
# Set Admin Mode console colors
#--------------------------------
# Check if running in admin mode
$IsElevated = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
Function Redraw-Screen{
# Save current console content
$bufferWidth = $host.ui.rawui.BufferSize.Width
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@OnceUponALoop
OnceUponALoop / puml-viewer.adoc
Last active October 1, 2020 21:56
Testing plantuml viewer from capitalone

@startuml

title "Push Notification Enrollment"

hide footbox autonumber "[0] "

participant "Developer" as User << (U, #ccebc5) user >> actor User as _user << (U, #ccebc5) user >> participant "Orchestration Layer" as Orch << (C, #b3cde3) capital one >>

@OnceUponALoop
OnceUponALoop / favicon.js
Created August 10, 2020 20:55 — forked from billti/favicon.js
Create inline GIF favicons
/* Bill Ticehurst, 2020
Emits a minimal 16 x 16 gif suitable for use as an inline favicon
GIF spec at https://www.w3.org/Graphics/GIF/spec-gif89a.txt for the structure
Favicon formats supported at https://en.wikipedia.org/wiki/Favicon
For a transparent GIF (color_table = false, depend_on_background = true) this emits:
<link rel="icon" href="data:image/gif;base64,R0lGODlhEAAQAAAAACwAAAAAAQABAAACASgAOw==">
@OnceUponALoop
OnceUponALoop / pulp-linkify.md
Created June 8, 2020 16:30
Pulp v3 Bookmarklet (PulpLinkify)

Converts Pulp v3 API urls to links I'm sure it can be more efficient but it's a quick hack for now.

Linkify Pulp Script

var pp = document.getElementsByClassName('prettyprint');

for (var i = 0; i < pp.length; i++){

  var matches = pp[i].getElementsByClassName('str');