Safari>=16.4,Firefox>=128,Chrome>=111,and_chr>=111,and_ff>=128,edge>=111,ios_saf>=16.4,opera>=97
2023-03-27 Safari 16.4+ 2023-03-07 Chrome 111+ 2024-07-09 Firefox 128+
| /** | |
| * Generate a short k-sortable ID with a given prefix. Useful for small amounts of IDs. | |
| * Can generate up to 260 ids per prefix by default, and could be tweaked to support even more if needed. | |
| */ | |
| function getShortId( | |
| prefix: 'd' | 's', | |
| lowercase = 'abcdefghijklmnopqrstuvwxyz', | |
| numbers = '0123456789', | |
| ) { | |
| let letterIndex = 0 |
| #!/usr/bin/bash | |
| # List installed flatpaks which have a command specified | |
| # These aliases can then be added to the PATH in for example .bashrc | |
| for bin in /var/lib/flatpak/exports/bin/*; do | |
| appid="$(basename $bin)" | |
| cmd="$(flatpak info -m $appid | awk -F= '/^command=/ {print $2}')" | |
| echo "alias ${cmd}=$bin" | |
| done |
Safari>=16.4,Firefox>=128,Chrome>=111,and_chr>=111,and_ff>=128,edge>=111,ios_saf>=16.4,opera>=97
2023-03-27 Safari 16.4+ 2023-03-07 Chrome 111+ 2024-07-09 Firefox 128+
| const FIVE_MINUTES = 1000 * 60 * 5 | |
| function createCache<K, V>({ maxAge }: { maxAge: number }) { | |
| const cache = new Map< | |
| K, | |
| V & { cachedAt: ReturnType<(typeof Date)['now']> } | |
| >() | |
| return { | |
| set(key: K, value: V) { | |
| cache.set(key, { ...value, cachedAt: Date.now() }) |
A workaround is to add the following to the post_install step in ios/Podfile. This way it will be automatically applied when you reinstall dependencies.
# Link headers to fix build on case sensitive file systems
# This will only be executed on case sensitive file systems where "pods" doesn't resolve to "Pods"
unless File.exist? "pods"
# For files, create a symlink with `ln -s`
system('cd Pods/Headers/Public; ln -s Protobuf protobuf')
# For directories, create a symlink with `ln -sfh`| const queue = []; | |
| const execute = () => { | |
| const action = queue[0]; | |
| if (action) { | |
| action().finally(() => { | |
| queue.shift(); | |
| execute(); | |
| }); | |
| } | |
| }; |
| /* | |
| Samuel Plumppu - 2018-02-27 | |
| You have a string s that consists of English letters, punctuation marks, whitespace characters, and brackets. It is guaranteed that the parentheses in s form a regular bracket sequence. | |
| Your task is to reverse the strings contained in each pair of matching parentheses, starting from the innermost pair. The results string should not contain any parentheses. | |
| Example | |
| For string s = "a(bc)de", the output should be |
| from math import sqrt | |
| def cache(F): | |
| """A simple cache decorator""" | |
| cache = dict() | |
| def wrapper(*args): | |
| try: | |
| return cache[args] | |
| except KeyError: | |
| # Result not in cache --> Calculate and store it |