Skip to content

Instantly share code, notes, and snippets.

View Matrix278's full-sized avatar
πŸ’»
Coding

Martin Sidorov Matrix278

πŸ’»
Coding
View GitHub Profile
@gmolveau
gmolveau / diff-so-fancy-install.sh
Last active October 8, 2024 04:13
ubuntu/debian diff-so-fancy install
LATEST_VERSION=$(curl -s https://api.github.com/repos/so-fancy/diff-so-fancy/releases/latest | grep -Po '"tag_name": "v\K[^"]*')
sudo curl -L -o /usr/local/bin/diff-so-fancy "https://github.com/so-fancy/diff-so-fancy/releases/download/v${LATEST_VERSION}/diff-so-fancy"
sudo chmod +x /usr/local/bin/diff-so-fancy
@ptkdev
ptkdev / lutris-legends-of-runeterra-openbeta.yml
Last active December 20, 2020 12:28
Run Legends of Runeterra on Linux with Lutris
# v1.3.0 - Lutris Installer for Legends of Runeterra Openbeta (forked from league of legends installer)
#
# [REQUIREMENTS]
# - Nvidia driver 430 or newer + vulkan
# - Wine 64bit, delete ~/.wine folder after intallation of wine64 from wine32
# - Archlinux, Manjaro, Ubuntu 18+ or Fedora
#
# [INSTALLATION]
# Install "Lutris" on linux https://lutris.net/
# Download this file and rename to: lutris-legends-of-runeterra-openbeta.yml
@crmaxx
crmaxx / install.log
Last active July 6, 2025 19:07
Installing and configuring P4Merge for Git on Ubuntu
# based on http://blogs.pdmlab.com/alexander.zeitler/articles/installing-and-configuring-p4merge-for-git-on-ubuntu/
$ cd ~/Downloads
$ wget https://cdist2.perforce.com/perforce/r18.2/bin.linux26x86_64/p4v.tgz
$ tar zxvf p4v.tgz
$ sudo mkdir /opt/p4v
@robertpainsi
robertpainsi / commit-message-guidelines.md
Last active October 17, 2025 19:00
Commit message guidelines

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages

Scaling your API with rate limiters

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.

# migrating from https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/git/git.plugin.zsh
# Aliases
alias g='git'
#compdef g=git
alias gst='git status'
#compdef _git gst=git-status
alias gd='git diff'
#compdef _git gd=git-diff
alias gdc='git diff --cached'