Skip to content

Instantly share code, notes, and snippets.

@stlk
stlk / rgb_spectrum.c
Created March 10, 2012 23:50 — forked from jimsynz/rgb_spectrum.c
Arduino sketch to cycle an RGB LED through the colour spectrum.
const int redPin = 11;
const int greenPin = 10;
const int bluePin = 9;
void setup() {
// Start off with the LED off.
setColourRgb(0,0,0);
}
void loop() {
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stlk
stlk / celery_django_redis_ratelimit.py
Last active November 11, 2021 08:05 — forked from Vigrond/celery_django_redis_ratelimit.py
RQ / Django / Redis Rate Limiting
# Rate limiting with Python RQ + Django + Redis
# Multiple Fixed Windows Algorithm inspired by Figma https://www.figma.com/blog/an-alternative-approach-to-rate-limiting/
import functools
from typing import Callable
import django_rq
from rq import Retry
from django.utils import timezone
from datetime import timedelta