Skip to content

Instantly share code, notes, and snippets.

🌒

Dalibor Mesarić dalibormesaric

🌒
View GitHub Profile
View SimpleFileVersioningBlobTrigger.csx
#r "Microsoft.Azure.WebJobs.Extensions.Storage"
public static async Task Run(Stream myBlob, Binder binder, string name, ILogger log)
{
if (name.Contains("_")) return;
log.LogInformation($"C# Blob trigger function Processed blob\n Name:{name} \n Size: {myBlob.Length} Bytes");
var fileName = Path.GetFileNameWithoutExtension(name);
var fileExtension = Path.GetExtension(name);
View SubscriptionChooser.ps1
$azExists = Get-InstalledModule Az -AllVersions -ErrorAction SilentlyContinue
if ($azExists) {
Write-Host "Az PowerShell installed ..."
}
else {
Write-Host "You need Az PowerShell https://docs.microsoft.com/en-us/powershell/azure/"
Break
}
View SQL_TRANSACTION.sql
BEGIN TRANSACTION
BEGIN TRY
--
--ROLLBACK
COMMIT
TRANSACTION
END TRY
@dalibormesaric
dalibormesaric / setup
Created Mar 25, 2015
Check for git, node, bower and install packages - CLI beginner friendly
View setup
@echo off
:: Check if git is installed
@ECHO Looking for git ...
call git --version >nul 2>nul
IF ERRORLEVEL 1 (
@ECHO Please install git from http://git-scm.com/downloads
goto :end_batch
)
call git --version
:: Check for node.js
@dalibormesaric
dalibormesaric / hyphens-camel-case.js
Last active Dec 30, 2017
Convert hyphens to camel case and convert camel case to hyphens
View hyphens-camel-case.js
("thisIsTest").replace(/([a-z][A-Z])/g, function (g) { return g[0] + '-' + g[1].toLowerCase() });
"this-is-test"
("this-is-test").replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); });
"thisIsTest"
You can’t perform that action at this time.