Skip to content

Instantly share code, notes, and snippets.

PowerShell standards 1.0


1. Coding Style

The purpose of this section is to define rules to ensure code which affects the appearance of code rather than the functionality.

1.1. No aliases in scripts or functions

Always use the full command and parameter names in scripts and functions as aliases are should only be used in console sessions. Using aliases will produce inconsistent code as you will end up with a combination of alias and full commands which results in reduced readability. This also applies to the symbol aliases such as:

@RA80533
RA80533 / export.lua
Created October 2, 2024 17:03 — forked from Kehet/export.lua
World of Warcrafts Dungeon Journal Exporter to XML (may cause hangout, use with caution)
local flags = {"tank", "dps", "healer", "heroic", "deadly", "important", "interruptible", "magic", "curse", "poison", "disease", "enrage", "enrage"}
local EJ_DIFF_N = 1
local EJ_DIFF_HC = 2
local EJ_DIFF_10 = 3
local EJ_DIFF_25 = 4
local EJ_DIFF_10HC = 5
local EJ_DIFF_25HC = 6
local EJ_DIFF_LFR = 7
local EJ_DIFF_CHA = 8
@RA80533
RA80533 / GTT_CreatureInspect.lua
Created August 30, 2024 20:23 — forked from Meorawr/GTT_CreatureInspect.lua
Creature Spawn Inspector
--
-- Creature GUID Inspector
--
function GTT_CreatureInspect(self)
local _, unit = self:GetUnit();
local guid = UnitGUID(unit or "none");
local prefix = string.match(guid, "^([CVP][^l][^-]+)");
if not guid or not prefix then
@RA80533
RA80533 / nlsh.py
Created May 8, 2024 01:20 — forked from dpoulopoulos/nlsh.py
OpenAI natural language shell example.
prompt = """
Input: Print the current directory
Output: pwd
Input: List files
Output: ls -l
Input: Change directory to /tmp
Output: cd /tmp
-- This example will configure an anchor to display the first private aura that
-- gets applied to the player.
--
-- Multiple calls for the same aura index can be made. This will in effect
-- create multiple distinct displays for the same aura index.
local AuraFrame1 = CreateFrame("Frame", UIParent);
AuraFrame1:SetPoint("CENTER");
AuraFrame1:SetSize(48, 48);
@RA80533
RA80533 / schema.sql
Created February 20, 2024 21:10 — forked from Gbps/schema.sql
CREATE DATABASE jpworgen;
CREATE TABLE IF NOT EXISTS jpworgen.ActiveItems
(
UpdateTime DateTime('UTC') CODEC (DoubleDelta),
ScanTime DateTime('UTC'),
RealmId UInt16,
Namespace LowCardinality(String),
Faction Enum8('Alliance' = 0, 'Horde' = 1),
AuctionId UInt32,

Improved .sr-only

Theorically bulletproof CSS class for visually hide anything and keep it accessible to ATs.

A Pen by ffoodd on CodePen.

License.

@RA80533
RA80533 / sed cheatsheet
Created May 2, 2023 14:09 — forked from ssstonebraker/sed cheatsheet
Sed Cheatsheet
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
@RA80533
RA80533 / example_usage.pp
Created November 8, 2022 21:55 — forked from yakatz/example_usage.pp
Manage System Git Config with Puppet
class myweb::sites::wiki_example_com {
wiki_base = '/var/www/sites/wiki.example.com'
include ::profile::gitconfig
profile::gitconfig::safe_directory {"${wiki_base}/code/mediawiki-1.35-LTS":}
vcsrepo { "${wiki_base}/code/mediawiki-1.35-LTS/":
ensure => latest,
provider => git,
source => '[email protected]:wiki/mediawiki-1.35-LTS.git',