Skip to content

Instantly share code, notes, and snippets.

@artydev
artydev / README.md
Created April 16, 2025 11:59 — forked from reold/README.md
Origin Private File System for all browsers. Pollyfill and an Abstraction Layer

📁 reold-opfs

A robust abstraction layer for the Origin Private File System (OPFS) API, allowing seamless file operations across all browsers. This package resolves Safari's limitations with OPFS, providing a consistent experience.

To learn more, watch this quick video:

thumbnail of a video about OPFS

📦 Installation

@artydev
artydev / myAngular.html
Created November 4, 2024 07:13 — forked from faustinoaq/myAngular.html
Front-end libraries (React, Vue, Angular) and the basic principles of how they work, all in a single file using pure JavaScript (VanillaJS).
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Angular from Scratch</title>
<style>
.my-component {
font-family: Arial, sans-serif;
@artydev
artydev / py_webview_webio_flask_sample.py
Created May 3, 2024 23:04 — forked from mkeneqa/py_webview_webio_flask_sample.py
sample starter code for using pywebio in pywebview with flask server on Windows
import webview
import pywebio
from pywebio.platform.flask import webio_view
from flask import Flask, escape, request, send_from_directory, current_app, url_for
from pywebio import STATIC_PATH
from pywebio.input import *
from pywebio.output import *
from pywebio.session import *
import logging
from datetime import date, timedelta
@artydev
artydev / compressionstring.js
Created April 30, 2024 08:55 — forked from alexis-martel/main.js
How to use the native Compression Streams API to compress and decompress strings in JavaScript
async function compressAndEncode(inputString) {
const encoder = new TextEncoder();
// Create a ReadableStream from the input string
const inputReadableStream = new ReadableStream({
start(controller) {
controller.enqueue(encoder.encode(inputString));
controller.close();
}
});
@artydev
artydev / build-free-angular-17-app-with-babel.html
Created March 25, 2024 08:37 — forked from reosablo/buildless-angular-17-app-with-babel.html
Build-free Angular 17 app with `@babel/standalone`
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Build-free Angular 17 app with @babel/standalone</title>
<script type="importmap">
{
"imports": {
"@angular/common": "https://esm.sh/v135/@angular/[email protected]?dev",
@artydev
artydev / AnalyticsHttpWrapper.cs
Created February 16, 2024 08:41 — forked from zola-25/AnalyticsHttpWrapper.cs
A wrapper for C# HttpClient to consume Asynchronous REST resources
public interface IAnalyticsHttpWrapper
{
Task<T> GetAsynchronous<T>(string path);
}
public class AnalyticsHttpWrapper : IAnalyticsHttpWrapper
{
private readonly IHttpClientFactory _httpClientFactory;
private readonly string _httpClientName;
private readonly HttpClient _httpClient;
@artydev
artydev / .block
Created May 6, 2023 11:50 — forked from nnattawat/.block
Histogram chart using d3.
license: gpl-3.0
height: 620
border: no
@artydev
artydev / histogram.js
Created May 6, 2023 11:45 — forked from vasgat/histogram.js
Draw histogram with d3.js
function histogramChart(color_value, title, xAxisTitle, yAxisTitle, num_of_of_bins) {
var margin = {top: 30, right: 40, bottom: 50, left: 50},
width = 460,
height = 300;
var histogram = d3.layout.histogram(),
x = d3.scale.ordinal(),
y = d3.scale.linear(),
xAxis = d3.svg.axis().scale(x).orient("bottom").tickSize(6, 0),
yAxis = d3.svg.axis()
@artydev
artydev / observable.js
Created November 7, 2020 20:52 — forked from Hoff97/observable.js
Very simple observable implementation
function Observable(observe) {
this.map = f => {
return new Observable(cb => {
this.observe(x => {
cb(f(x));
});
});
}
this.flatMap = f => {
@artydev
artydev / EventHandler.js
Created September 10, 2020 09:06 — forked from Larkenx/EventHandler.js
JavaScript Goal Driven AI with Event Streams, based on socket.io's API & Caves of Qud goal driven AI https://youtu.be/4uxN5GqXcaA
export default class EventHandler {
constructor(eventStream) {
this.eventStream = eventStream
}
on(topic, fn) {
this.eventStream.addEventListener(topic, fn)
return this
}
}