Skip to content

Instantly share code, notes, and snippets.

View PakL's full-sized avatar

Pascal Pohl PakL

View GitHub Profile
@PakL
PakL / downgrade.php
Created October 11, 2022 08:50
Stream Deck OBS Button downgrade from 5.3 to 5.2
<?php
$mainProfileFolder = getenv('APPDATA') . DIRECTORY_SEPARATOR . 'Elgato' . DIRECTORY_SEPARATOR . 'StreamDeck' . DIRECTORY_SEPARATOR . 'ProfilesV2';
//$mainProfileFolder = __DIR__;
function downgradeOBS($action) {
if($action['UUID'] === 'com.elgato.obsstudio.scene') {
$action['UUID'] = 'com.elgato.streamdeck.obs.scene';
if(!isset($action['Settings']['sceneId']) && isset($action['Settings']['scene'])) {
$action['Settings']['sceneId'] = $action['Settings']['scene'];
@PakL
PakL / Hendraheim.md
Created April 2, 2022 16:26
Hendraheim Items

Hendraheim Items

Swords

  • Dragonbane
  • Dawnbreaker
  • Ebony Blade
  • Harkon's Sword
  • Bloodskal Blade
  • Bloodscythe
  • Soulrender
@PakL
PakL / Nightbot dice roll.md
Last active January 15, 2024 18:48
Nightbot command to roll dice

Simple Nightbot command to roll any number of any kind of dice

$(eval var i=parseInt,d=[],e='$(provider)'=='twitch'?'melziiD20':'🎲20',j=0,l,m='$(query)'.match(/^(([0-9]+)\s+)?(([0-9]+)?d([0-9]+)|([0-9]+))$/)??{},c=i(m[2]??1),n=i(m[4]??1),s=i(m[5]??m[6]??20);c=c>20?20:(c<1||!c?1:c);n=(n<1?1:n);s=(s<1?1:s);for(;j<c;j+=1){d.push(Math.round(n*(s-1)*Math.random())+n)}r=`$(user) rolled ${d.join(', ')} with ${n<2?'a ':n+'×'}🎲`+s;l=r.lastIndexOf(',');(l<0?r:r.substr(0,l)+' and'+r.substr(l+1)).replace(/( |🎲)20(,| |$)/g,` ${ e } $2`))

Examples:
!roll - PakL rolled a 2 with a 🎲6
!roll 20 - PakL rolled a 14 with a 🎲20
!roll 2d6 - PakL rolled a 11 with 2×:game_die:6

param (
[Parameter(Mandatory=$true)][string]$ComputerName,
[int]$Port = 443
)
Write-Host "Checking certificate for: " -Foreground DarkYellow -NoNewline
Write-Host "$($ComputerName):$($Port)" -Foreground Yellow
$Certificate = $null
$TcpClient = New-Object -TypeName System.Net.Sockets.TcpClient
@PakL
PakL / test.php
Last active March 17, 2016 07:04
msphpsql crash on fetching
<?php
$mssql_resource = sqlsrv_connect(MSSQL_HOST, array("Database" => MSSQL_DATABASE, "UID" => MSSQL_USER, "PWD" => MSSQL_PASSWORD, "CharacterSet" => "UTF-8"));
if(is_resource($mssql_resource)) {
// Query WITHOUT parameters and DEFINED fetchType: Works fine
$stmt = sqlsrv_prepare($mssql_resource, "SELECT TOP 5 * FROM [table]");
if($stmt !== false) {
if(sqlsrv_execute($stmt)) {