Skip to content

Instantly share code, notes, and snippets.

@tomatrow
tomatrow / rcWidget.js
Created February 4, 2022 19:24 — forked from milesw/rcWidget.js
rcWidget.js
import 'core-js/es6/array';
import 'core-js/es6/object';
import 'core-js/es6/string';
// Global options
import defaults from './_config';
// general helper functions
import Helper from './_helpers';
// general pricing and currency functions
import Pricing from './_pricing';
// throttle and debounce manager
@tomatrow
tomatrow / Route.svelte
Last active December 4, 2020 08:47 — forked from RedHatter/Route.svelte
Single file router for svelte.
<script>
import UrlPattern from 'url-pattern'
import location, { navigate, noMatch } from './location.js'
export let path
export let component = undefined
export let redirect = undefined
$: pattern = new UrlPattern(path)
$: router = {
@tomatrow
tomatrow / dict.fish
Last active October 28, 2017 22:32 — forked from RomanHargrave/assoc.fish
# ASCII Unit separator, purpose is to separate subrecords, etc...
set __dict_US \31
# Groks name[key] and sets varname and key variables
function dict._parsename -S -a raw
set -l data (string match -r '(.+)\[(.+)\]' $raw)
if [ (count $data) -lt 3 ]
echo "Invalid dictionary syntax '$raw'"
return 1
else