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 datetime | |
import random | |
import smtplib | |
from email.mime.text import MIMEText | |
from email.mime.multipart import MIMEMultipart | |
def secret_santa(names): | |
"""Assigns a Secret Santa for each person in the list avoiding cycles of two.""" | |
# Check for a valid number of participants |
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
/** | |
* File: useIndexedDB.js | |
* | |
* This file contains a custom hook for interacting with IndexedDB, a low-level API for client-side storage of significant amounts of structured data. | |
* | |
* The hook takes three parameters: | |
* 1. `databaseName`: The name of the IndexedDB database you want to interact with. | |
* 2. `storeName`: The name of the object store in the database. | |
* 3. `key`: The key of the value you want to read or write in the object store. | |
* |
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
# THIS IMPLEMENTATION IS PART OF A BLOG POST ABOUT: | |
# "Achieving Reliable Zero Downtime Re-indexing with Searchkick" | |
module Searchkick | |
# Module to check for reindexing and duplicate jobs to the new index | |
module ReindexCheck | |
def perform(*args, **options) | |
job_type = self.class.name.demodulize | |
class_name, index_name, record_ids = extract_job_details(job_type, args, options) |
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
# Git AI Shell Functions and Utilities | |
# Author: Lucas Oliveira | |
# Last Modified: 2024-03-16 | |
############################################################################### | |
# CONFIGURATION | |
############################################################################### | |
# Update the default Claude model to use the latest version |
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
require 'sidekiq/api' | |
# 1. Clear retry set | |
Sidekiq::RetrySet.new.clear | |
# 2. Clear scheduled jobs | |
Sidekiq::ScheduledSet.new.clear |