Discover gists
A collection of snippets |
if ('serviceWorker' in navigator) { | |
caches.keys().then(function(cacheNames) { | |
cacheNames.forEach(function(cacheName) { | |
caches.delete(cacheName); | |
}); | |
}); | |
} |
This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.
On March 29th, 2024, a backdoor was discovered in xz-utils, a suite of software that
module.exports = async function updateDate(params) { | |
/* | |
This function does the following things: | |
1. Gets the current date. | |
2. Reads the contents of the current file. | |
3. When a line that contains `date::` is found, adds the current date as a note to the end of the line. | |
*/ | |
let currDate = moment().format('YYYY-MM-DD'); | |
const currentFile = params.app.workspace.getActiveFile(); | |
const fileContents = await params.app.vault.read(currentFile); |
import React, { useRef } from 'react' | |
import { NativeSyntheticEvent, TextInput, TextInputKeyPressEventData, View } from 'react-native' | |
import { useStyles } from 'lib/hooks' | |
import { createStyles } from 'lib/styles' | |
import { Nullable } from 'lib/types' | |
type OTPInputProps = { | |
length: number, | |
value: Array<string>, | |
disabled: boolean, |
import csv | |
import random | |
# 1000000 and 52 == roughly 1GB (WARNING TAKES a while, 30s+) | |
rows = 1000000 | |
columns = 52 | |
print_after_rows = 100000 | |
def generate_random_row(col): | |
a = [] |
Sometimes, we have to access git repositories over SSL and the server only provides a self-signed certificate 🙈. Although there are ways to increase the trust level for the self-signed certificate (https://confluence.atlassian.com/fishkb/unable-to-clone-git-repository-due-to-self-signed-certificate-376838977.html, https://confluence.atlassian.com/bitbucketserverkb/resolving-ssl-self-signed-certificate-errors-806029899.html), my recommendation is to just ignore SSL verification alltogether.
Prepend GIT_SSL_NO_VERIFY=true
before every git command run to skip SSL verification. This is particularly useful if you haven't checked out the repository yet.
Run git config http.sslVerify false
to disable SSL verification if you're working with a checked out repository already.