Skip to content

Instantly share code, notes, and snippets.

@threeel
threeel / Leaderboard Using Redis
Created July 3, 2025 20:40 — forked from wonjun27/Leaderboard Using Redis
Leaderboard Using Redis
Leaderboard Using Redis
http://labs.strava.com/blog/koms-powered-by-redis/
Strava KOMS, Powered by Redis
----------------
http://aimeeault.com/2014/06/22/making-the-most-of-redis-and-sorted-sets/
For example, what if I only want to see a leaderboard of members who are between the ages of 18 and 49? The Sorted Set contains no information on how old each member is. And I don’t want to maintain a separate Redis Sorted Set for just these users, because that’s kind of redundant, right? You probably don’t want to fetch every single one of the potentially hundreds of thousands of records and filter individually… that’s not very efficient! There’s a couple of ways you could approach this with Redis. One is by way of Lua scripting with use of EVAL (which runs Lua) and ZSCAN (which can be used for matching keys and values by rules, similar to regular expressions).
@threeel
threeel / Sony WH-1000XM4.md
Created December 19, 2024 07:43 — forked from peters/Sony WH-1000XM4.md
Connecting Sony WH-1000XM4 to Ubuntu 22.04 (Jammy)

Connecting Sony WH-1000XM4 to Ubuntu 22.04 (Jammy)

This guide will help you connect your Sony WH-1000XM4 headset to Ubuntu 22.04 using Bluetooth. Once connected, you'll be able to listen to music and use the microphone on apps like Microsoft Teams.

1. Connect to Bluetooth Headset

Steps:

  1. Open a terminal and launch bluetoothctl:
bootstrap/cache/services.php
storage/app/*
storage/logs/*
vendor/**/test*
vendor/**/tests*
vendor/**/Tests*
Derivation Machine
https://www.loom.com/share/a120b44b796f45b5af024a6c87b1ec7b
https://stackoverflow.com/questions/69051106/c-or-c-websocket-client-working-example
https://www.pythonsherpa.com/static/files/html/Financial%20Market%20Instruments%20-%20Unique%20Identifiers.html
@threeel
threeel / AppName.php
Created August 18, 2022 14:16 — forked from isluewell/AppName.php
[6.0] Command app:name
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Composer;
use Symfony\Component\Finder\Finder;
use Illuminate\Filesystem\Filesystem;
use Symfony\Component\Console\Input\InputArgument;
@threeel
threeel / .psysh.php
Created May 4, 2022 20:55
.psysh.php
<?php
$defaultIncludes = [];
$composerAutoload = getcwd() . DIRECTORY_SEPARATOR . '/vendor/autoload.php';
if (is_file($composerAutoload)) {
$defaultIncludes[] = $composerAutoload;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@threeel
threeel / listen.py
Created November 29, 2021 11:40 — forked from kissgyorgy/listen.py
How to use PostgreSQL's LISTEN/NOTIFY as a simple message queue with psycopg2 and asyncio
import asyncio
import psycopg2
# dbname should be the same for the notifying process
conn = psycopg2.connect(host="localhost", dbname="example", user="example", password="example")
conn.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT)
cursor = conn.cursor()
cursor.execute(f"LISTEN match_updates;")