Skip to content

Instantly share code, notes, and snippets.

{
"scripts": [],
"styles": []
}
@xavaz
xavaz / default.html
Last active May 6, 2024 10:58
default
lol --
@SenZmaKi
SenZmaKi / main.ts
Last active May 6, 2024 10:57
When dealing with numerous high-resolution large file size images in Chromium, you might encounter janky scrolling or other issues since rendering the images blocks the main thread (UI thread). To address this issue, we use a canvas to compress the images first. To avoid blocking the main thread during compression, we perform the compression in …
import type {
CompressorWorkerDTO,
CompressorWorkerResponseDTO,
CompressorWorkerParams,
} from "./types.ts";
// Function to get the compressed image URL using a web worker
export const getCompressedImageUrl = (() => {
let worker: Worker | undefined = undefined;
@YeapGuy
YeapGuy / airtag-decryptor.swift
Last active May 6, 2024 10:57
Decrypt macOS Find My .record file
//
// airtag-decryptor.swift
//
//
// Created by Matus on 28/01/2024.
//
import Foundation
import CryptoKit
// Function to decrypt using AES-GCM
@FeralFlora
FeralFlora / 01 Zotero Integration import template and more!.md
Last active May 6, 2024 10:57
Zotero import template for the Zotero integration plugin for Obsidian. Screenshots and usage guide over in the Obsidian forum here (somewhat outdated guide): https://forum.obsidian.md/t/zotero-integration-import-templates/36310/105?u=feralflora
  • ZI-main.md
    • The main Zotero Integration template
  • runImport.md
    • Template that enables updating literature notes at the click of a button, and much more.
  • Meta bind button template
    • Template for in-note button that executes runImport.md
@domenic
domenic / default-export.md
Last active May 6, 2024 10:56
Default default export = MIO?

Intro

Idea: could we make the "default default export" the module instance object?

So for:

// a.js
export const x = 1;
export const y = 2;
@fogti
fogti / inspect.js
Created January 10, 2022 20:21
nixpkgs/lib/systems with-import cycle
let nixOp = nixBlti.nixOp;
let nixBltiRT = nixBlti.initRtDep(nixRt);
let nixInScope = nixBlti.mkScopeWith();
return async (nixBound) => {
nixBound = await nixBound;
let nix__lib = nixOp._lambdaA2chk(nixBound, "lib");
return (async (nixInScope) =>
(async (nixInScope) =>
(async (nixInScope) =>
nixBlti.PLazy.from(async () => {
@tasdikrahman
tasdikrahman / irssi.md
Last active May 6, 2024 10:54
irssi cheatsheet
<?php get_header(); ?>
<div class="f--container">
<div class="f--row">
<div class="f--col-6">
<?php
if ( have_posts() ) :
while ( have_posts() ) : the_post();
// Your loop code
$blocks = parse_blocks( $post->post_content );
$content_markup = '';
@NereaFontecha
NereaFontecha / Lazy Loading
Created May 16, 2023 14:31
Lazy Loading + load Invisible
const lazy = new Blazy({
selector: ".g--lazy-01",
successClass: "g--lazy-01--is-loaded",
offset: 300,
loadInvisible: true,
});