- Security is a fundamental topic when creating sustainable software.
- Protect your users, your organization or even yourself in mainly two ways:
- Protect their personal data
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 |
/* | |
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 |
const queue = []; | |
const execute = () => { | |
const action = queue[0]; | |
if (action) { | |
action().finally(() => { | |
queue.shift(); | |
execute(); | |
}); | |
} | |
}; |
// Credit to plugin solution and making it show up in editor intellisense: | |
// https://github.com/tailwindlabs/tailwindcss-intellisense/issues/227#issuecomment-1221083129 | |
const plugin = require('tailwindcss/plugin') | |
const textShadowPlugin = plugin(({ addUtilities }) => { | |
addUtilities({ | |
'.text-shadow': { | |
'text-shadow': '1px 1px 1px #0000003f', | |
}, |
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 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() }) |