Discover gists
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
# /etc/nginx/geoblocker | |
# This will block anything but the defined countries and the networks defined in the $localnet variable | |
set $geoblock 0; | |
if ($geoip_country_code !~ (DK|NO|SE)) { set $geoblock 1; } | |
if ($localnet = 1){ set $geoblock 0; } | |
if ($geoblock = 1){ return 403; } |
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
from langchain.chat_models import ChatOpenAI | |
from langchain.prompts import ChatPromptTemplate | |
from langchain.schema.output_parser import StrOutputParser | |
import requests | |
from bs4 import BeautifulSoup | |
from langchain.schema.runnable import RunnablePassthrough, RunnableLambda | |
from langchain.utilities import DuckDuckGoSearchAPIWrapper | |
import json | |
RESULTS_PER_QUESTION = 3 |
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
A collection of snippets |
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
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
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
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); |
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 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, |
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 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 = [] |
NewerOlder