Skip to content

Instantly share code, notes, and snippets.

View sjkp's full-sized avatar

Simon J.K. Pedersen sjkp

View GitHub Profile
View index.html
<!DOCTYPE html>
<canvas id="mandelbrotCanvas" width="800" height="800"></canvas>
const canvas = document.getElementById('mandelbrotCanvas');
const ctx = canvas.getContext('2d');
const imgData = ctx.createImageData(canvas.width, canvas.height);
const MAX_ITERATION = 1000;
sjkp / both.json
Created October 17, 2022 20:57 — forked from torumakabe/both.json
Sample ARM template for Azure Container Apps (Cron with Dapr & KEDA)
View both.json
"$schema": "",
"contentVersion": "",
"parameters": {
"location": {
"defaultValue": "canadacentral",
"type": "String"
"environment_name": {
"defaultValue": "containerapps-env",
sjkp /
Created March 6, 2022 16:31 — forked from tiantuxu/
Common ffmpeg Command Lines (with NVIDIA GPU Support)
# Decode a video to yuv420 raw format
ffmpeg -vsync 0 -c:v h264_cuvid -i input.mp4 -c:v rawvideo -pix_fmt yuv420p -f null /dev/null
ffmpeg -vsync 0 -c:v h264_cuvid -i input.mp4 -c:v rawvideo -pix_fmt yuv420p output.yuv
# Resize videos to 640x480
ffmpeg -c:v h264_cuvid -i input.mp4 -vf scale=640:480 -c:v h264_nvenc output.mp4
# Downsampling frame rate to 30fps
ffmpeg -i input.mp4 -r 30 -c:v h264_nvenc output.mp4
sjkp / LuceneNetExample.cs
Created November 8, 2021 22:12 — forked from mtmk/LuceneNetExample.cs
Quick and complete Lucene.Net example
View LuceneNetExample.cs
using System;
using System.Globalization;
using Lucene.Net.Analysis.Standard;
using Lucene.Net.Documents;
using Lucene.Net.Index;
using Lucene.Net.QueryParsers;
using Lucene.Net.Search;
using Lucene.Net.Store;
using Version = Lucene.Net.Util.Version;
sjkp / openapi-spec
Created March 21, 2021 14:37
Generate openapi from Logic Apps
View openapi-spec
"swagger": "2.0",
"info": {
"version": "",
"title": "REMOVED",
"description": "Azure Logic App."
"host": "",
"basePath": "/workflows/931ae63fd6b6459e88c2cf43ed366b20/triggers",
"schemes": [
sjkp / certificate.bicep
Last active March 21, 2021 15:01
Bicep template for requesting app service certificates
View certificate.bicep
param domainNames array
param appServicePlanName string
param location string = resourceGroup().location
resource certificates 'Microsoft.Web/certificates@2020-06-01' = [for domainName in domainNames: {
name: domainName
location: location
properties: {
canonicalName: domainName
sjkp / continents.geojson
Last active June 14, 2019 18:49
View continents.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
sjkp / proxies.json
Created March 26, 2017 20:22
Azure Function proxy support
View proxies.json
"proxies": {
"ListAll": {
"desc": [
"This is the index of examples."
"matchCondition": {
"methods": [
sjkp / Get-FileEncoding
Created April 4, 2016 19:33
View 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 / office-groups-connector-webhook.ps1
Created April 1, 2016 12:42
Posts an action card to Office Group using the WebHook Connector
View office-groups-connector-webhook.ps1
Posts an action card to Office Group using the WebHook Connector
The url to the web hook connector as registered in the Office 365 Group.
The title to show on the action card.
.PARAMETER message