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 / promplistenumber.txt
Created October 1, 2024 22:18
LLAMA3 créer un eliste
Je vais te donner un liste de nombres, écrit les uns sou les autres, avec le nombres de lettres qu'il contient, voici le format:
1 : deux lettres
2 : quatre lettres
la liste est composée des 20 premiers nombres entiers (1,2,3...20)
Résultat:
@artydev
artydev / promptcorrection.txt
Created October 1, 2024 22:04
LLAMA3 instruct corriger un texte
S'il vous plaît, corriger le texte ci dessous. Votre texte doit être :
1. Grammaticalement correct
2. Élégamment écrit
3. Soutenant une idée principale cohérente
4. Bien structuré (introduction, développement, conclusion)
5. Sans erreurs orthographiques ou de grammaire
6. Fluide et naturel dans son expression
7. Restez assez proche du texte initial
Ecrivez la réponse entre guillemets sans aucun autre commentaire ou description
@artydev
artydev / albertapi.py
Created October 1, 2024 19:30
Albert FastApi
import os
from fastapi import FastAPI, HTTPException
from pydantic import BaseModel
from openai import OpenAI
from typing import Optional
from fastapi.middleware.cors import CORSMiddleware
app = FastAPI()
class UserMessage(BaseModel):
message: str
@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 / async_request_html.py
Created August 27, 2023 21:09
Demonstration of async requests with requests-html
from requests_html import AsyncHTMLSession
session = AsyncHTMLSession()
async def get_cnn():
r = await session.get('https://edition.cnn.com/')
title = r.html.find('title')[0].text
print(title)