Skip to content

Instantly share code, notes, and snippets.

View Hrxn's full-sized avatar
☯️
"He who knows, does not speak. He who speaks, does not know."

HRXN Hrxn

☯️
"He who knows, does not speak. He who speaks, does not know."
  • Germany
  • 17:08 (UTC +02:00)
View GitHub Profile

Credit: Mark Kraus
Website: https://get-powershellblog.blogspot.com

Collection Type Guidence

When to use what

  • Use Arrays if you know the element types and have a fixed length and/or known-up-front collection size that will not change.
  • Use ArrayList if you have an unkown collection size with either unknown or mixed type elements.
  • Use a Generic List when know the type of the elements but not the size of the collection.
  • Use a HashTable if you are going to do key based lookups on a collection and don't know the object type of the elements.
  • Use a Dictionary<TKey, TValue> you are going to do key based lookups on a collection and you know the type of the elements.
  • Use a HashSet when you know the type of elements and just want unique values and quick lookups and assignmnets.
@fnky
fnky / ANSI.md
Last active May 7, 2024 09:24
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active May 6, 2024 10:42
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@agyild
agyild / FSR.glsl
Last active May 6, 2024 09:48
AMD FidelityFX Super Resolution v1.0.2 for mpv
// Copyright (c) 2021 Advanced Micro Devices, Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
@agyild
agyild / NVScaler.glsl
Last active May 3, 2024 14:51
NVIDIA Image Scaling v1.0.2 for mpv
// The MIT License(MIT)
//
// Copyright(c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files(the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions :
@agyild
agyild / CAS-scaled.glsl
Last active April 26, 2024 18:17
AMD FidelityFX Contrast Adaptive Sharpening v1.0.2 for mpv
// LICENSE
// =======
// Copyright (c) 2017-2019 Advanced Micro Devices, Inc. All rights reserved.
// -------
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,
// modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
// -------
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
@bjin
bjin / acme-0.5x.hook
Last active April 21, 2024 01:55
simple 0.5x prescaler for mpv, best combined with "--cscale=bilinear --scaler-resizes-only --window-scale=0.5"
//!DESC acme-0.5x
//!HOOK LUMA
//!BIND HOOKED
//!WIDTH HOOKED.w 2 /
//!HEIGHT HOOKED.h 2 /
//!WHEN HOOKED.w 2 % ! HOOKED.h 2 % ! *
//!OFFSET 0.25 0.25
vec4 hook() {
return HOOKED_texOff(vec2(-0.25,-0.25));
}
@phiresky
phiresky / motioninterpolation.vpy
Last active April 11, 2024 00:36
Realtime motion interpolating 60fps playback in mpv
# vim: set ft=python:
# see the README at https://gist.github.com/phiresky/4bfcfbbd05b3c2ed8645
# source: https://github.com/mpv-player/mpv/issues/2149
# source: https://github.com/mpv-player/mpv/issues/566
# source: https://github.com/haasn/gentoo-conf/blob/nanodesu/home/nand/.mpv/filters/mvtools.vpy
import vapoursynth
core = vapoursynth.get_core()
$framework = 'netstandard2.0'
$folder = 'EventHubs'
$packages = 'Azure.Messaging.EventHubs', 'Azure.Messaging.EventHubs.Processor'
dotnet new classlib -f $framework -o "$folder.package" &&
Push-Location "$folder.package" &&
$packages | ForEach-Object { dotnet add package $_ } &&
dotnet publish --configuration Release -o lib &&
Add-Type -Path .\lib\*.dll &&
Pop-Location
@TheAMM
TheAMM / mpv_geometry_freezer.lua
Created November 13, 2018 23:33
mpv_geometry_freezer.lua keeps your mpv window size unchanging
--[[
mpv_geometry_freezer.lua
Sets the geometry property when window size changes,
avoiding Windows' maximized windows detaching.
- AMM
]]--
local msg = require 'mp.msg'
local UPDATE_INTERVAL = 0.5
local screen_w, screen_h = mp.get_osd_size()