Skip to content

Instantly share code, notes, and snippets.

{
"final_space": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"horizontal_offset": 0,
"vertical_offset": 0,
@erisonliang
erisonliang / sql-wasm-base64.js
Created March 4, 2024 00:39 — forked from SMUsamaShah/sql-wasm-base64.js
SQLite WASM (v1.8.0) as BASE64
const SQLBASE64 = "AGFzbQEAAAABrQRHYAJ/fwF/YAF/AX9gA39/fwBgAX8AYAN/f38Bf2ACf38AYAR/f39/AX9gBX9/f39/AX9gBH9/f38AYAZ/f39/f38Bf2AFf39/f38AYAJ/fgF/YAR/f39+AX9gBn9/f39/fwBgB39/f39/f38Bf2AAAX9gAXwBfGABfgF/YAJ/fgBgA39/fgF/YAJ/fwF+YAAAYAF/AX5gBH9+f38Bf2AHf39/f39/fwBgCX9/f39/f39/fwF/YAh/f39/f39/fwF/YAN/fn8Bf2ACf3wAYAV/fn5+fgBgCX9/f39/f39/fwBgBX9/f39+AGAFf39+f38Bf2ADf39+AGADf35/AGADf35+AX9gAAF8YAF/AXxgBH9+fn8AYAh/f39/f39/fwBgBH5+fn4Bf2ALf39/f39/f39/f38AYAN8fH8BfGACfHwBfGAEf39+fwBgBn9/f35/fwF/YAF+AX5gBX9+f39/AX9gAn9+AX5gBn9/f39/fgF/YAR/f39/AX5gAn5+AXxgCH9+fn9/f39/AX9gAn58AX9gC39/f39/f39/f39/AX9gAnx/AXxgAXwBf2ACfH8Bf2AHf39/f35/fwF+YAl/fn9+fn5+f38Bf2AEf39/fgBgAnx+AX9gCn9/f39/f39/f38Bf2ADf398AX9gB39/f39/fHwAYAF8AX5gBX9+fn5/AX9gCH9/fn5+f39/AX9gBH9+f38AYA1/f39/f39/f39/f39/AGACf38BfALNASIBYQFhAAgBYQFiAAQBYQFjAAEBYQFkACQBYQFlACQBYQFmAAEBYQFnAAQBYQFoAAABYQFpAAABYQFqAAUBYQFrAAcBYQFsAAQBYQFtAAABYQFuAAIBYQFvAAYBYQFwAAQBYQFxAA8BYQFyAAYBYQFzAAEBYQF0AAYBYQF1AAYBYQF2AAYBYQF3AAkBYQF4AAkBYQF5AAQBYQF6AAABYQFBAAABYQFCAAABYQFDAAEBYQFEAAYBY
@erisonliang
erisonliang / SkiaCanvas.cs
Created March 1, 2024 06:20 — forked from Aurumaker72/SkiaCanvas.cs
SkiaCanvas for Avalonia 11
public class SkiaRenderEventArgs : EventArgs
{
public SkiaCanvas Sender { get; init; }
public SKCanvas Canvas { get; init; }
}
public class SkiaCanvas : UserControl
{
private class SkiaCallbackRenderOperation : ICustomDrawOperation
{
@erisonliang
erisonliang / clr_array_convert.md
Created May 23, 2023 23:44 — forked from robbmcleod/clr_array_convert.md
Convert NumPy `ndarray` to C# `System.Array` and back again

Originally for Python 3.7 and PythonNet 2.4.0 I wrote a snippet of code to transform NumPy ndarray into System.Array from CLR and back again using pure python and the ctypes package memmove function:

https://github.com/pythonnet/pythonnet/issues/514
https://github.com/pythonnet/pythonnet/issues/652

However, after the release of PythonNet 2.5.0 there were some changes to the PythonNet interface that created some small breaks in my code snippet:

@erisonliang
erisonliang / simple_idw.ipynb
Created February 1, 2023 08:22 — forked from Majramos/simple_idw.ipynb
Simple inverse distance weighted (IDW) interpolation with python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@erisonliang
erisonliang / .block
Created October 11, 2022 14:48 — forked from john-guerra/.block
Vega-lite: load data dynamically on run-time with vegaEmbed
license: mit
@erisonliang
erisonliang / VisualStudioAttacher.cs
Created September 13, 2022 03:33 — forked from atruskie/VisualStudioAttacher.cs
A class for programmatically attaching Visual Studio to debug a process. It can be used to automatically attach Visual Studio to your process. It can dynamically attach any solution to any process.
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="AutoAttachVs.cs" company="QutEcoacoustics">
// All code in this file and all associated files are the copyright and property of the QUT Ecoacoustics Research Group (formerly MQUTeR, and formerly QUT Bioacoustics Research Group).
// </copyright>
// <summary>
// Example taken from this gist.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
#if DEBUG
@erisonliang
erisonliang / MyClass.cs
Created September 8, 2022 07:30 — forked from merthmagic/MyClass.cs
round-robin load balance algorithm C# demo
using System;
using System.Collections.Generic;
using RoundRobin;
public class MyClass
{
public static void RunSnippet()
{
List<Node> servers = new List<Node>();
servers.Add(new Node("serv","urlA",1));
@erisonliang
erisonliang / DLLLoader.cs
Created September 3, 2022 02:55 — forked from dstpierre/DLLLoader.cs
Prototype call C# methods from Go using stdin/stdout and a C# wrapper around the libraries
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Your.Library.Here;
namespace ProtoDLLBridge
@erisonliang
erisonliang / ProcessHelper.cs
Created September 2, 2022 23:56 — forked from ygoe/ProcessHelper.cs
ProcessHelper class: Provides methods for process execution and handling in C#. Because it's hard.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using DotforwardControl.Shared.Extensions;
namespace DotforwardControl.Shared.Util
{