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 / 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\"
@MarioBinder
MarioBinder / jquery.js
Created October 29, 2021 12:44
load jquery in console
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
// ... give time for script to load, then type (or see below for non wait option)
jQuery.noConflict();
//https://stackoverflow.com/a/7474386/119109