Skip to content

Instantly share code, notes, and snippets.

@jonbeebe
jonbeebe / .eslintignore
Last active December 24, 2023 06:00
Recommended ESLint and Prettier config for React TypeScript
src/tests
node_modules
build
dist
dist-ssr
.vscode
public
*.test.js
*.test.jsx
*.test.ts
@jonbeebe
jonbeebe / .eslintignore
Last active December 24, 2023 06:01
Recommended ESLint and Prettier config for React JavaScript
src/tests
node_modules
build
dist
dist-ssr
.vscode
public
*.test.js
*.test.jsx
@jonbeebe
jonbeebe / fuzzymatch.js
Created December 17, 2023 03:42
Basic fuzzy matching and filtering functions written in JavaScript.
// fuzzymatch.js - Basic fuzzy matching and filter functions.
//
// Full explanation and usage here:
// https://jonbeebe.net/2023/12/basic-fuzzy-matching-function
//
export const fuzzyMatch = (searchFor, inTarget) => {
const search = (searchFor || "").trim().toLowerCase();
const target = (inTarget || "").trim().toLowerCase();
const searchLength = search.length;
@jonbeebe
jonbeebe / fuzzymatch.ts
Last active December 17, 2023 03:45
Basic fuzzy matching and filtering functions written in TypeScript.
// fuzzymatch.ts - Basic fuzzy matching and filter functions.
//
// Full explanation and usage here:
// https://jonbeebe.net/2023/12/basic-fuzzy-matching-function
//
export const fuzzyMatch = (searchFor: string, inTarget: string): number => {
const search = (searchFor || "").trim().toLowerCase();
const target = (inTarget || "").trim().toLowerCase();
const searchLength = search.length;
{
"screens": {
"Tab1": {
"title": "T1 Tab",
"styles": {
"main": {
"backgroundColor": "green",
"width": "100%",
"height": "100%"
}
@jonbeebe
jonbeebe / cloudSettings
Last active July 3, 2020 00:52
vscode-settings-sync
{"lastUpload":"2020-07-03T00:52:20.727Z","extensionVersion":"v3.4.3"}
@jonbeebe
jonbeebe / Frontmatter.pm
Last active October 25, 2018 01:22
Separate YAML front-matter from Markdown content in a text file. Depends on YAML and Text::Markdown::Hoedown modules.
use strict;
use warnings;
package Frontmatter;
use YAML;
use Text::Markdown::Hoedown;
my $PATTERN = qr/
^\s* # possible whitespace
@jonbeebe
jonbeebe / list_splice.py
Last active September 6, 2021 07:14
Port of JavaScript Array.prototype.splice() to Python 3
def list_splice(target, start, delete_count=None, *items):
"""Remove existing elements and/or add new elements to a list.
target the target list (will be changed)
start index of starting position
delete_count number of items to remove (default: len(target) - start)
*items items to insert at start index
Returns a new list of removed items (or an empty list)
"""
@jonbeebe
jonbeebe / asound.state
Created October 24, 2015 09:48 — forked from n1trux/asound.state
asound.state for Toshiba Chromebook 2 (CB30-B-104)
state.Intel {
control.1 {
iface CARD
name 'HDMI/DP,pcm=3 Jack'
value false
comment {
access read
type BOOLEAN
count 1
}