Skip to content

Instantly share code, notes, and snippets.

View NielsGregers's full-sized avatar

Niels Gregers Johansen NielsGregers

  • Espergaerde, Denmark
View GitHub Profile
@NielsGregers
NielsGregers / index.html
Created October 12, 2016 15:32
Send Fax based on coping a document and converting it to PDF
<h2 class="animated rubberband">Sending a fax</h2>
<h3>Technical flow</h3>
<ul>
<li>A template is copied to the folder "/fax/10-new" and named [timestamp]-[templatename].docx</li>
<li>Properties are set on the document [timestamp]-[templatename].docx</li>
<li>When the column "Fax to number" is filled out, the document will automatically be moved to the folder "/fax/20-processing", and a PDF conversion is requested</li>
<li>A processs is monitoring the folder "/fax/20-processing", and a when a matching PDF file is found, the .DOCX and .PDF files are moved to the folder "/fax/90-processed"</li>
</ul>
<hr/>
<button class="animated bounce" onclick="sendFax('master1.docx')">Click here to create a new document</button>
@NielsGregers
NielsGregers / sn2vsts-incidents.js
Last active March 6, 2017 15:38
ServiceNow (SN) and Visual Studio Team Services (VSTS) integration
/*
* Incidents from ServiceNow
*
*/
/**
* compares source and target array - match source.key with target.foreignKey
*
* @param {any} source
* @param {any} target
@NielsGregers
NielsGregers / vsto-additem.js
Last active March 6, 2017 15:39
Creating a workitem in Visual Studio Team Services and inserting the ServiceNow Business Consequence
/*
Creating a workitem in Visual Studio Team Services and inserting the ServiceNow Business Consequence
*/
function serviceNowGetDescription(auth, snTenant,sys_id, cb) {
var unirest = require("unirest");
var req = unirest.get("https://" + snTenant + ".service-now.com/api/now/v1/table/incident/" + sys_id);
req.headers({
"cache-control": "no-cache",
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
-- DROP TABLE [dbo].[FlowStatusLog]
GO
CREATE TABLE [dbo].[FlowStatusLog](
[id] [bigint] NOT NULL,
@NielsGregers
NielsGregers / Wheel of colors.yaml
Created December 12, 2018 14:18
Uses chart formatting to draw a wheel with changing colors. Contributed by Alexander Zlatkovski. - Shared with Script Lab
name: Wheel of colors
description: Uses chart formatting to draw a wheel with changing colors. Contributed by Alexander Zlatkovski.
author: NielsGregers
host: EXCEL
api_set: {}
script:
content: |
$("#wheel").click(wheelGo);
$("#stop").click(wheelStop);
. "$PSScriptRoot\.hexatown.com.ps1" # Load the Hexatown framework
$hexatown = Start-Hexatown $myInvocation # Start the framework
$myTeams = List $hexatown my teams by displayName # Read the Teams of the delegate user sorted by name
foreach ($team in $myTeams ) # Repeat code for each team
{ # Start code block
Write-Host $team.displayName # Write the value of a team to the host
} # End code block
Stop-Hexatown $hexatown # Stop the framework
@NielsGregers
NielsGregers / Matt-Blog-post.ps1
Last active January 24, 2021 16:36
Getting Matts blog post out of WebFlow
$hexatown = Start-Hexatown $myInvocation # Start the framework
$webflow = API webflow login # Load API and sign in
$site = API $webflow first sites # Set a Site reference
$collections = API $webflow $site list collections # Load all collections
Each $collections { # Show name of each collection
write-host $item.name
}
#***************************************
# Hexatown API Definition for WebFlow
#***************************************
function APIInstance (){
@{
_name = "Webflow"
_version = "1.0"
_root = "https://api.webflow.com/"
_headers = @{
Authorization = "Bearer $($ENV:WEBFLOW)"