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 / LuceneNetExample.cs
Created November 8, 2021 22:12 — forked from mtmk/LuceneNetExample.cs
Quick and complete Lucene.Net example
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
sjkp / ffmpeg-common.sh
Created March 6, 2022 16:31 — forked from tiantuxu/ffmpeg-common.sh
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
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)
{
"$schema": "https://schema.management.azure.com/schemas/2019-08-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"defaultValue": "canadacentral",
"type": "String"
},
"environment_name": {
"defaultValue": "containerapps-env",
<!DOCTYPE html>
<html>
<body>
<canvas id="mandelbrotCanvas" width="800" height="800"></canvas>
<script>
const canvas = document.getElementById('mandelbrotCanvas');
const ctx = canvas.getContext('2d');
const imgData = ctx.createImageData(canvas.width, canvas.height);
const MAX_ITERATION = 1000;
New Microsoft Azure reference architectures and implementation guidance are now generally available for customers to confidently design and deploy intelligent apps. Customers can easily leverage patterns and practices to create private chatbots that are reliable, cost-efficient and compliant — adhering to both the functional and nonfunctional requirements of an organization.
The new guidance helps customers adopt well-architected best practices and includes:
A reference architecture and reference implementation for Microsoft Azure OpenAI Service based on Azure landing zones, which helps jumpstart and scale app deployment.
Service guides for machine learning that gives precise configuration instructions for Azure services used to deliver intelligent apps.
Patterns for designing and developing a RAG solution: While the architecture is straightforward, designing, experimenting with, and evaluating RAG solutions that fit into this architecture involves many complex considerations that benefit from a rigorous, s
@sjkp
sjkp / welcome.html
Last active August 19, 2024 17:18
CloudFlare-EmailForm
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Modern Contact Form</title>
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js" defer></script>
<style>
body {
font-family: Arial, sans-serif;
@sjkp
sjkp / readme.md
Last active February 12, 2025 22:41
Build spellfix.dll for sqlite3 on windows

Download the source files from the SQLite website: https://www.sqlite.org/download.html Get the sqlite-amalgamation ZIP and the sqlite-src ZIP, you will need both.

Extract the sqlite-src ZIP to a temporary folder. Open the sqlite-amalgamation ZIP and copy the sqlite3.h, sqlite3.c and sqlite3ext.h files to clipboard. Open to where you extracted the sqlite-src ZIP with Windows Explorer then go into the ext/misc folder. Paste the 3 files into that folder.

Next, open a visual studio developer x64 prompt and change to the sqlite-src/ext/misc folder. Enter the following command to compile the extension: cl /I . /LD spellfix.c /link /OUT:spellfix.dll

Import the spellfix.dll into your SqliteStudio using the Extension Manager.

@sjkp
sjkp / sql-server-m1-mac.md
Created February 16, 2025 18:55 — forked from Fronix/sql-server-m1-mac.md
How to use SQL server on M1 Mac

How to use SQL server on M1 Mac

Prerequisites

  • Docker & docker-compose
  • Brew

Setup Colima VM

brew install colima