You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Load configs from ERB based YML files in Rails application
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
Apache detailed log format - Print Referer, User-Agent, X-Forwarded-For
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
Iterate over the git repositories in current directory and do git pull
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
Upload Directory to AWS S3 using boto3 python SDK. Files will be uploaded if last modified time newer than existing file. Also sets file MIME type.
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 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
Kong, Traefik, Caddy, Linkerd, Fabio, Vulcand, and Netflix Zuul seem to be the most common in microservice proxy/gateway solutions. Kubernetes Ingress is often a simple Ngnix, which is difficult to separate the popularity from other things.
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
[{"name":"Colombo","channels":[{"map":"r_PK61Dt","href":"/listen/coop-radio/r_PK61Dt","title":"Coop Radio","subtitle":"Maharagama","id":"id8a401705-6766-9164-17ce-a5346f2fa38e","name":"Coop Radio","src":"https://radio.garden/api/ara/content/listen/r_PK61Dt/channel.mp3?id8a401705-6766-9164-17ce-a5346f2fa38e"},{"map":"fo8bhE4s","href":"/listen/free-fm/fo8bhE4s","title":"Free FM","subtitle":"Kotikawatta","id":"id26060e93-15ee-1442-f1ac-0c7a7aec0e8d","name":"Free FM","src":"https://radio.garden/api/ara/content/listen/fo8bhE4s/channel.mp3?id26060e93-15ee-1442-f1ac-0c7a7aec0e8d"},{"href":"/listen/hirufm/xyIbSGbn","title":"Hiru FM 96.1","id":"idffeeb3c7-4ada-af94-0ab8-926609a1e0f2","name":"Hiru FM 96.1","src":"https://radio.garden/api/ara/content/listen/xyIbSGbn/channel.mp3?idffeeb3c7-4ada-af94-0ab8-926609a1e0f2"},{"map":"xyIbSGbn","href":"/listen/hirufm/xyIbSGbn","title":"Hiru FM 96.1","subtitle":"Colombo","id":"id420953ad-8179-234b-0ef9-b5587c5c4eca","name":"Hiru FM 96.1","src":"https://radio.garden/api/ara/conten
The following are examples of the four types rate limiters discussed in the accompanying blog post. In the examples below I've used pseudocode-like Ruby, so if you're unfamiliar with Ruby you should be able to easily translate this approach to other languages. Complete examples in Ruby are also provided later in this gist.
In most cases you'll want all these examples to be classes, but I've used simple functions here to keep the code samples brief.
Request rate limiter
This uses a basic token bucket algorithm and relies on the fact that Redis scripts execute atomically. No other operations can run between fetching the count and writing the new count.
Simple Python 3 HTTP server for logging all GET and POST requests
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