Skip to content

Instantly share code, notes, and snippets.

View dalibormesaric's full-sized avatar
🌑

Dalibor Mesarić dalibormesaric

🌑
View GitHub Profile
#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);
$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
}
BEGIN TRANSACTION
BEGIN TRY
--
--ROLLBACK
COMMIT
TRANSACTION
END TRY
@dalibormesaric
dalibormesaric / setup
Created March 25, 2015 14:28
Check for git, node, bower and install packages - CLI beginner friendly
@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 December 30, 2017 10:41
Convert hyphens to camel case and convert camel case to hyphens
("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"