Skip to content

Instantly share code, notes, and snippets.

View sjkp's full-sized avatar

Simon J.K. Pedersen sjkp

View GitHub Profile
@sjkp
sjkp / continents.geojson
Last active June 14, 2019 18:49
ports.geojson
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sjkp
sjkp / proxies.json
Created March 26, 2017 20:22
Azure Function proxy support
{
"proxies": {
"ListAll": {
"desc": [
"This is the index of examples."
],
"matchCondition": {
"methods": [
"GET"
],
@sjkp
sjkp / Get-FileEncoding
Created April 4, 2016 19:33
Get-FileEncoding
function Get-FileEncoding
{
[CmdletBinding()] Param (
[Parameter(Mandatory = $True, ValueFromPipelineByPropertyName = $True)] [string]$Path
)
[byte[]]$byte = get-content -Encoding byte -ReadCount 4 -TotalCount 4 -Path $Path
@sjkp
sjkp / office-groups-connector-webhook.ps1
Created April 1, 2016 12:42
Posts an action card to Office Group using the WebHook Connector
<#
.SYNOPSIS
Posts an action card to Office Group using the WebHook Connector
.DESCRIPTION
.
.PARAMETER url
The url to the web hook connector as registered in the Office 365 Group.
.PARAMETER title
The title to show on the action card.
.PARAMETER message
@sjkp
sjkp / export web part url
Created March 25, 2016 12:07
Export Web Part SharePoint
https://intranet.contoso.com/_vti_bin/exportwp.aspx?pageurl=https://intranet.contoso.com/Pages/default.aspx&guidstring=0c3adfe9-8f5d-4432-918a-42410e4e324d
param
(
[Parameter(Mandatory=$true, HelpMessage="Enter Azure Subscription name. You need to be Subscription Admin to execute the script")]
[string] $subscriptionName,
[Parameter(Mandatory=$true, HelpMessage="Provide a password for SPN application that you would create")]
[string] $password,
[Parameter(Mandatory=$false, HelpMessage="Provide a SPN role assignment")]
[string] $spnRole = "owner"
@sjkp
sjkp / Azure-VM-Extensions
Created August 22, 2015 09:57
Azure VM Extensions Complete list
Id : /Subscriptions/cd0d7179-80a0-47e6-a201-9c12de0bbd37/Providers/Microsoft.Compute/Locations/westeurope
/Publishers/alertlogic/ArtifactTypes/VMExtension/Types/AlertLogicLM/Versions/1.3.0.1
Location : westeurope
PublisherName : alertlogic
Type : AlertLogicLM
Version : 1.3.0.1
FilterExpression :
Id : /Subscriptions/cd0d7179-80a0-47e6-a201-9c12de0bbd37/Providers/Microsoft.Compute/Locations/westeurope
/Publishers/AlertLogic.Extension/ArtifactTypes/VMExtension/Types/AlertLogicLM/Versions/1.3.0.0
@sjkp
sjkp / fake-sp2013-installation.reg
Created July 20, 2015 11:18
Fake SharePoint installation to create WSP solution
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\15.0]
"SharePoint"="Installed"
"Location"="C:\\Program Files\\Common Files\\Microsoft Shared\\Web Server Extensions\\15\\"
@sjkp
sjkp / download-azure-arm-templates
Created June 28, 2015 22:02
Download Azure ARM templates from the gallery
New-Item -path 'C:\Azure\arm-Templates\' -type directory -Force
$microsoftTemplates = Get-AzureResourceGroupGalleryTemplate -Publisher 'Microsoft'
foreach ($item in $microsoftTemplates)
{
$identity = $item.'Identity'
Save-AzureResourceGroupGalleryTemplate -Identity $identity `
-Path C:\Azure\arm-Templates\ `
@sjkp
sjkp / remove-nodemodules
Created June 13, 2015 17:04
Remove node_modules on windows
Install RimRaf:
npm install rimraf -g
And in the project folder delete the node_modules folder with:
rimraf node_modules