Skip to content

Instantly share code, notes, and snippets.

View michaeltlombardi's full-sized avatar

Mikey Lombardi (He/Him) michaeltlombardi

View GitHub Profile
@michaeltlombardi
michaeltlombardi / CustomTypeExample.psd1
Created November 2, 2023 14:26
PowerShell module with accelerated and usable custom types.
@{
RootModule = 'CustomTypeExample.psm1'
ModuleVersion = '0.1.0'
GUID = '2779fa60-0b3b-4236-b592-9060c0661ac2'
Author = 'mikey'
CompanyName = 'Unknown'
Copyright = '(c) mikey. All rights reserved.'
FunctionsToExport = @(
'New-AcceleratedClass'
'New-UsableClass'
@michaeltlombardi
michaeltlombardi / readme.md
Created February 12, 2022 17:44
Itch devlog source example

Example source for an itch devlog, using this devlog from 2022-02-12.

The view-source.html file was retrieved by copying the code from view source in the browser and prettifying it for easier reading.

@michaeltlombardi
michaeltlombardi / profile_helpers.ps1
Last active December 11, 2023 13:14
Cross Platform theming and prompt built on FiraCode, Monokai, and Starship
#region Custom Function Definitions
Function Test-Administrator {
$CurrentUser = [Security.Principal.WindowsIdentity]::GetCurrent()
$AdministratorRole = [Security.Principal.WindowsBuiltInRole] "Administrator"
([Security.Principal.WindowsPrincipal]$CurrentUser).IsInRole($AdministratorRole)
}
#endregion
#region Prompt Prep
# Set ENV for elevated status
@michaeltlombardi
michaeltlombardi / bigmikey.psm1
Created October 16, 2020 14:04
oh-my-posh bigmikey
#requires -Version 2 -Modules posh-git
function Write-Theme
{
param(
[bool]
$lastCommandFailed,
[string]
$with
)
@michaeltlombardi
michaeltlombardi / basic.pp
Last active April 14, 2020 19:26
Example Puppet Manifest using the PowerShellGet DSC Resources
dsc_psrepository {'Add team module repo':
dsc_name => 'foo',
dsc_ensure => present,
# This location is nonsense, can be any valid folder on your
# machine or in a share, any location the SourceLocation param
# for the DSC resource will accept.
dsc_sourcelocation => 'C:\Program Files',
dsc_installationpolicy => untrusted,
}
@michaeltlombardi
michaeltlombardi / Gemfile
Last active October 1, 2019 18:40
Example demo for ruby-pwsh gem
# frozen_string_literal: true
source 'https://rubygems.org'
gem 'irbtools'
gem 'ruby-pwsh'
gem 'fuubar'
if RUBY_VERSION == "1.8.7"

$ConvertedFilter

(enabled -eq $True -and PasswordNeverExpires -eq $False -and WhenCreated -lt $WhenCreated -and samAccountType -eq "805306368")

$ConvertedFilter -replace '\(enabled', '($_.enabled'

((enabled -eq $True -and PasswordNeverExpires -eq $False -and WhenCreated -lt $WhenCreated -and samAccountType -eq "805306368").enabled -eq $True -and PasswordNeverExpires -eq $False -and WhenCreated -lt $WhenCreated -and samAccountType -eq "805306368")
---
driver:
name: vagrant
provisioner:
name: chef_zero
always_update_cookbooks: true
verifier:
name: inspec
---
driver:
name: vagrant
provisioner:
name: chef_zero
always_update_cookbooks: true
verifier:
name: inspec
Verifying that "michaeltlombardi.id" is my Blockstack ID. https://onename.com/michaeltlombardi