Skip to content

Instantly share code, notes, and snippets.

@pesterhazy
pesterhazy / indexeddb-problems.md
Last active March 29, 2024 08:00
The pain and anguish of using IndexedDB: problems, bugs and oddities

This gist lists challenges you run into when building offline-first applications based on IndexedDB, including open-source libraries like Firebase, pouchdb and AWS amplify (more).

Note that some of the following issues affect only Safari. Out of the major browsers, Chrome's IndexedDB implementation is the best.

Backing file on disk (WAL file) keeps growing (Safari)

When this bug occurs, every time you use the indexeddb, the WAL file grows. Garbage collection doesn't seem to be working, so after a while, you end up with gigabytes of data.

Random exceptions when working with a large number of indexeddb databases (Safari)

@mecid
mecid / Calendar.swift
Last active March 29, 2024 08:00
SwiftUI Calendar view using LazyVGrid
import SwiftUI
extension Calendar {
func generateDates(
inside interval: DateInterval,
matching components: DateComponents
) -> [Date] {
var dates: [Date] = []
dates.append(interval.start)
@fschwar4
fschwar4 / sinc_interpolation.py
Last active March 29, 2024 07:59
Fast Python implementation of Whittaker–Shannon / sinc / bandlimited interpolation.
import numpy as np
from numpy.typing import NDArray
def sinc_interpolation(x: NDArray, s: NDArray, u: NDArray) -> NDArray:
"""WhittakerShannon or sinc or bandlimited interpolation.
Args:
x (NDArray): signal to be interpolated, can be 1D or 2D
s (NDArray): time points of x (*s* for *samples*)
u (NDArray): time points of y (*u* for *upsampled*)
@guest271314
guest271314 / javascript_engines_and_runtimes.md
Last active March 29, 2024 07:59
A list of JavaScript engines, runtimes, interpreters

V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++. It is used in Chrome and in Node.js, among others. It implements ECMAScript and WebAssembly, and runs on Windows 7 or later, macOS 10.12+, and Linux systems that use x64, IA-32, ARM, or MIPS processors. V8 can run standalone, or can be embedded into any C++ application.

SpiderMonkey is Mozilla’s JavaScript and WebAssembly Engine, used in Firefox, Servo and various other projects. It is written in C++, Rust and JavaScript. You can embed it into C++ and Rust projects, and it can be run as a stand-alone shell. It can also be [compiled](https://bytecodealliance.org/articles/making-javascript-run-fast-on

@alpteo
alpteo / semantic-commit-messages-with-emojis.md
Last active March 29, 2024 07:57
Semantic Commit Messages with Emojis

Semantic Commit Messages with Emojis

Commit format: <emoji_type> <commit_type>(<scope>): <subject>. <issue_reference>

Example

:sparkles: feat(Component): Add a new feature. Closes: #
^--------^ ^--^ ^-------^   ^---------------^  ^------^
|          |    |           |                  |
| | | | +--&gt; (Optional) Issue reference: if the commit closes or fixes an issue
@rxaviers
rxaviers / gist:7360908
Last active March 29, 2024 07:53
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@greeflas
greeflas / install-toolbox.sh
Last active March 29, 2024 07:53
JetBrains Toolbox installation script for Ubuntu - https://www.jetbrains.com/toolbox/app/
#!/bin/bash
set -e
if [ -d ~/.local/share/JetBrains/Toolbox ]; then
echo "JetBrains Toolbox is already installed!"
exit 0
fi
echo "Start installation..."
@elecnix
elecnix / chatgpt-ocr.py
Created November 6, 2023 01:39
OCR with ChatGPT Plus
"""
OCR with ChatGPT Plus
Convert a bunch of image files into text, using Playwright to control your Chrome browser.
Prerequisites:
- Run `chrome --remote-debugging-port=9222`
- Log in to ChatGPT
- Select GPT-4
"""