Skip to content

Instantly share code, notes, and snippets.

View MarioBinder's full-sized avatar
:octocat:
.

Mario Binder MarioBinder

:octocat:
.
View GitHub Profile
@MarioBinder
MarioBinder / collatz.cs
Last active May 27, 2025 05:52
Collatz-Folge
/*
Die Collatz-Vermutung oder 3n+1-Vermutung. Sie wurde 1937 vom deutschen Mathematiker Lothar Collatz formuliert und gehört zu den bekanntesten offenen Problemen der Mathematik. Die Vermutung lautet:
Starte mit einer beliebigen positiven ganzen Zahl n.
Wenn n gerade ist, setze n := n / 2.
Wenn n ungerade ist, setze n := 3n + 1.
Wiederhole diesen Vorgang.
Die Vermutung behauptet, dass unabhängig von der Startzahl die Folge immer irgendwann die Zahl 1 erreicht.
@MarioBinder
MarioBinder / shellout_windows.go
Created September 24, 2024 11:50
skeema shellout for compiling in windows
// This file contains shellout functionality that is specific to Windows.
//go:build windows
// +build windows
package shellout
import (
"context"
"fmt"
@MarioBinder
MarioBinder / execute.job.from.database.sql
Last active April 3, 2024 09:27
execute job from database
Use Master
GO
EXEC master.dbo.sp_configure 'show advanced options', 1
RECONFIGURE WITH OVERRIDE
GO
EXEC master.dbo.sp_configure 'xp_cmdshell', 1
RECONFIGURE WITH OVERRIDE
GO
@MarioBinder
MarioBinder / CronTab-Expander.sql
Created August 29, 2023 09:54 — forked from LSTANCZYK/CronTab-Expander.sql
Expand CronTab expressions with SQL / T-SQL
USE Exercises
GO
/* ***********************************************************************************************
*
* CRONTAB EXPANDER
*
* ***********************************************************************************************/
/**************************************************************************************************
@MarioBinder
MarioBinder / levenshtein.ts
Created August 8, 2022 06:01
levenshtein.ts
export function levenshtein(a: string, b: string): number {
if (!a.length) {
return b.length;
}
/* c8 ignore next 3 */
if (!b.length) {
return a.length;
}
@MarioBinder
MarioBinder / compareFolders.ps1
Created June 9, 2022 14:38
compare to folders (with manipulatings foldernames)
$Folder1 = Get-ChildItem -Name "D:\Gitserver\Repositories" | foreach {$_.ToLower() + ".git"}
$Folder2 = Get-childitem -Name "D:\Gitea\Repositories\wdmm" | foreach {$_.ToLower() }
Compare-Object $Folder1 $Folder2
@MarioBinder
MarioBinder / 1.readme.md
Last active March 14, 2022 17:18
open sublime links from webpage

sublime-protocol-win

Setting up Custom URI scheme handler for Windows to open files in Sublime editor
Created to parse URI's generated by filp/whoops
Parsing is done with VBScript, as that was the only way I found to open Sublime editor, while avoiding annoying command prompt window to pop up and close.

NOTE

After downloading / cloning the repository, you have to edit files to update path to open_file.vbs and to add path to Sublime editor
Currently I don't have time to create install/uninstall scripts, so any help is welcome
Also, README.md is all upside-down, so that will be updated soon

@MarioBinder
MarioBinder / enableOleAutomation.sql
Last active February 24, 2022 12:14 — forked from JahsonKim/enableOleAutomation.sql
How to send http POST request from sql server stored procesdure.
--This query enables ole automation procedures. set 0 to disable
exec master.dbo.sp_configure 'Ole Automation Procedures', 1
RECONFIGURE
--OLE automation disabled the following error is thrown.
--SQL Server blocked access to procedure 'sys.sp_OACreate' of component
--'Ole Automation Procedures' because this component is turned off as part
--of the security configuration for this server.
--A system administrator can enable the use of 'Ole Automation Procedures'
@MarioBinder
MarioBinder / tools.bat
Created November 19, 2021 15:11
faster delete folder in windows
rmdir /s/q foldername
@MarioBinder
MarioBinder / tools.bat
Last active January 3, 2022 13:17
command line -> cd unc / network folders
create a temp virtual drive: pushd "\\172.29.0.30\"
delete the virtual drive: popd "\\172.29.0.30\"