Skip to content

Instantly share code, notes, and snippets.

View jeffhollan's full-sized avatar
❄️
Working

Jeff Hollan jeffhollan

❄️
Working
View GitHub Profile
module.exports = function (context, data) {
context.res = {
body: parseQuery(data.form)
};
context.done();
};
function parseQuery(qstr) {
{
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2015-08-01-preview/workflowdefinition.json#",
"triggers": {
"manual": {
"inputs": {
"schema": {}
},
"type": "Manual"
}
},
module.exports = function (context, data) {
context.log('Webhook was triggered!');
var message = data.message;
var rx = /(<\?xml.*>)/g;
var xml = rx.exec(message)[1];
context.res = {
body: xml
};
module.exports = function (context, data) {
context.log('Webhook was triggered!');
var buffer = new Buffer(data.body, 'base64');
context.res = {
status: 200,
body: buffer.toString('utf8')
}
context.done();
Param(
[string] $ResourceGroupName = 'YourResourceGroup',
[string] $ResourceLocation = 'Region | eastus | westus | ...',
[string] $ConnectionName = 'SalesforceSandbox',
[string] $subscriptionId = 'xxxxxxxx-xxxx-xxxx-xxxx-9250f1c8ab03',
[bool] $createConnection = $true,
[bool] $isSandbox = $true
)
#r "Newtonsoft.Json"
using System;
using System.Net;
using Newtonsoft.Json;
public static async Task<object> Run(HttpRequestMessage req, TraceWriter log)
{
log.Verbose($"Webhook was triggered!");
@jeffhollan
jeffhollan / PullAllLocalBranches.ps1
Last active January 6, 2022 05:30
PowerShell script to pull all local branches
function PullAllBranches() {
$branches = git branch
foreach($branch in $branches){
$fixedBranch = $branch.Substring(2, $branch.Length - 2)
$trackedExpression = "branch." + $fixedBranch + ".merge"
$trackedBranch = git config --get $trackedExpression
# Write-Host($trackedBranch)
if(![string]::IsNullOrEmpty($trackedBranch))
{
Write-Host('Pulling branch: ' + $fixedBranch)
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"logicAppName": {
"type": "string",
"minLength": 1,
"maxLength": 80,
"metadata": {
"description": "Name of the Logic App."
@json(substring(base64toString(triggerBody()['ContentData']), indexof(base64toString(triggerBody()['ContentData']), '{'), sub(lastindexofof(base64toString(triggerBody()['ContentData']), '}'), indexof(base64toString(triggerBody()['ContentData']), '{'))))
@jeffhollan
jeffhollan / SwaggerGenerator.ps1
Created March 3, 2017 18:20
PowerShell to grab swagger for Logic app
Param(
[string]$subscriptionId = "80d4fe69-xxxx-xxxx-xxxx-9250f1c8ab03",
[string]$resourceGroup = "name-of-resource-group",
[string]$logicAppName = "name-of-logic-app",
[string]$triggerName = "manual"
)
Function Get-Folder()
{