-
Cache-Oblivious Algorithms and Data Structures - Erik Demaine (One of the earliest papers in cache oblivious data structures and algorithms that introduces the cache oblivious model in detail and examines static and dynamic cache oblivious data structures built between 2000-2003)
-
Cache Oblivious B-Trees - Bender, Demaine, Farch-Colton (This paper presents two dynamic search trees attaining near-optimal performance on any hierarchical memory. One of the fundamental papers in the field where both search trees discussed match the optimal search bound of Θ(1+log (B+1)N) memory transfers)
-
Cache Oblivious Search Trees via Binary Trees of Small Height - Brodal, Fagerberg, Jacob (The data structure discussed in this paper works on the version of [2] but avoids the use o
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
Classify user search queries as either "Good Google Search Query" or "Bad Google Search Query" based on their likelihood of yielding relevant and helpful results from Google Search. | |
Input: User search query (text string). | |
Output: Classification label: | |
* Good Google Search Query: The query is likely to be effectively answered by Google Search. | |
* Bad Google Search Query: The query is unlikely to be effectively answered by Google Search. Further categorize "Bad" queries into subtypes for better understanding and classifier training (optional but highly recommended): | |
* Chit-Chat/Conversational/Social | |
* Personal/Subjective/Opinion-Based (Un-searchable) | |
* Vague/Ambiguous/Lacking Specificity |
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
Mix.install([:mint, :castore]) | |
defmodule Main do | |
def run() do | |
total = | |
Stream.resource( | |
fn -> | |
{:ok, conn} = Mint.HTTP.connect(:https, "ftp.bit.nl", 443, mode: :passive) | |
{:ok, conn, _ref} = Mint.HTTP.request(conn, "GET", "/speedtest/10mb.bin", [], nil) | |
{conn, true} |
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
.event.kind = "event" | |
.event.type = ["info"] | |
.event.category = ["web"] | |
.o365.audit = object!(del(.json.o365audit)) | |
if .o365.audit.CreationTime != null { | |
creation_time, err = split(string!(.o365.audit.CreationTime), "Z")[0] + "Z" | |
.ts = to_timestamp!(creation_time) | |
} |
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 pihole/pihole:latest | |
# Run s6 in its own PID namespace so that it is PID 1, even when the | |
# environment already has its own init process (fly.io has a non-optional | |
# one), to avoid this error: | |
# s6-overlay-suexec: fatal: can only run as pid 1 | |
# | |
# Un-ignore SIGINT and SIGTERM signals so that s6-init and all its child | |
# processes don't default to ignoring those signals. A bug in the "unshare" | |
# utility propagates ignoring these signals to the child process, which is |
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
#!/bin/sh | |
curl -s https://bunnycdn.com/api/system/edgeserverlist -H "Accept: application/json" | jq -r .[] > /tmp/bunny_ips | |
echo "" >> /tmp/bunny_ips | |
curl -s https://bunnycdn.com/api/system/edgeserverlist/ipv6 -H "Accept: application/json" | jq -r .[] >> /tmp/bunny_ips | |
for ip in `cat /tmp/bunny_ips`; do ufw allow proto tcp from $ip comment 'Bunny IP'; done; |
- Create a bot using @BotFather, get it's token
- Start conversation with bot
- Run following curl command
curl https://api.telegram.org/bot/getUpdates | grep -Po '"from":{"id":.+?,'
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
# [🟨OPTIONAL] Uninstall old docker versions | |
sudo apt-get remove docker docker-engine docker.io containerd runc | |
# Refresh latest version | |
sudo apt-get update | |
# Install pre-req | |
sudo apt-get install -y \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
gnupg \ |
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
defmodule Acme.Repo do | |
use Ecto.Repo, | |
otp_app: :acme, | |
adapter: Ecto.Adapters.Postgres | |
def with_prefix(prefix) do | |
module_atom = Module.concat([Acme, Repo, WithPrefix, Macro.camelize(prefix)]) | |
# We could not find a better way to see if this module already existed | |
if !Kernel.function_exported?(module_atom, :prefix, 0) do |
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
# Step 1 | |
def create_subscription(email, plan_id, payment_method_id) do | |
with %User{customer_id: nil, name: name} = user <- | |
Repo.get_by(User, email: email), | |
{:ok, %Stripe.Customer{id: customer_id}} <- | |
Stripe.Customer.create(%{ | |
name: name, | |
email: email, | |
payment_method: payment_method_id, |
NewerOlder