This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script lang="ts"> | |
interface Tab { | |
title: string | |
} | |
export let tabs: Tab[] | |
export let selected = 0 | |
</script> | |
<ul class="flex w-full border-b"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const semanticVersionRegex = /^\d+(\.?[\d]+){0,2}$/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { writable, get } from 'svelte/store' | |
const initialState = { | |
supported: false, | |
allowed: false, | |
error: null, | |
location: null, | |
loading: false, | |
timestamp: -1, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Setter<T> { | |
(value: T): void | |
} | |
export function useStore <T> (store: Writable<T>) : [T, Setter<T>]{ | |
const initialValue: T = get(store); | |
const [value, setValue] = useState(initialValue); | |
useEffect(() => store.subscribe(setValue), []); | |
return [value, store.set]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "\n\nCloning IDF v3.3.1\n\n" | |
mkdir -p ~/esp | |
cd ~/esp | |
git clone --branch v3.3.1 --recursive git@github.com:espressif/esp-idf.git | |
echo "Installing components\n\n" | |
cd esp-idf | |
./install.sh | |
echo "Setting up environment\n\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. Internal API | |
interface Resource<Data, Props = any> { | |
// here goes the INTERNAL API provided by the core that | |
// should be used by other libraries/frameworks to provide | |
// the real user interface | |
// We can also provide an API for debugging and other tools | |
subscribe: (cb: () => Data) => UnsubscribeFunction, | |
run: (props: Props, options: RunOptions) => Data, | |
abort: () => void, | |
update: (props: Props, currentData: Data) => Data, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get page links | |
const elements = document.getElementsByTagName('a') | |
const links = [] | |
for(const link of elements) links.push(link) | |
// filter wanted torrents | |
const hrefs = links | |
.filter(l => l.innerText === '720p') | |
.map(l => l.href) | |
const torrents = hrefs | |
.map(href => /magnet.*/.exec(href)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# # SDKMAN | |
# export SDKMAN_DIR="$HOME/.sdkman" | |
# [[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh" | |
# GO | |
export PATH="$PATH:$HOME/go/bin" | |
# ZINIT | |
if [[ ! -f $HOME/.zinit/bin/zinit.zsh ]]; then |