Skip to content

Instantly share code, notes, and snippets.

View haunt98's full-sized avatar
:octocat:
Keep creating bugs

sudo pacman -Syu haunt98

:octocat:
Keep creating bugs
View GitHub Profile
@gboncoffee
gboncoffee / uwufiew.c
Last active August 14, 2023 13:04
UwUfiew algorithm
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
/*
* uwufiew, weceives inpuwut fwom standawt inpuwut ow fiwes and concatenates a
* uwufiewd vewsion to the standawt ouwutpuwut.
*
* fwee softwawe, wincesed uwundew the MIT wicense, youwu shouwuwd have
* weceived a copy of the wicense awong with the pwogwam.
@kconner
kconner / macOS Internals.md
Last active July 7, 2024 19:42
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@brandur
brandur / go.mod
Last active July 25, 2023 21:41
PartialEqual implementation
module github.com/brandur/prequire
go 1.19
require github.com/stretchr/testify v1.8.1
require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
@sm-Fifteen
sm-Fifteen / whats_a_yubikey.md
Last active July 15, 2024 07:08
"What the heck is a Yubikey and why did I buy one?": A user guide

"What the heck is a Yubikey and why did I buy one?": A user guide

(EDIT: Besides Reddit, I've also put this up on Github Gist)

So while looking for information on security keys before getting one myself, I got very confused reading about all the different modes and advertised features of Yubikeys and other similar dongles. The official documentation tends to be surprisingly convoluted at times, weirdly organized and oddly shy about a few of the limitations of these keys (which I'm making a point of putting front and center). Now that I have one, I decided to write down everything I figured out in order to help myself (and hopefully some other people reading this) make sense of all this.

Since I'm partly writing these notes for myself, there might be some back and forth between "exp

@kaushikgopal
kaushikgopal / private-build-plans.toml
Last active August 10, 2023 19:05
Iosevka (KG's customization for Iosevka) see https://blog.jkl.gg/build-iosevka-font-mac-os/
[buildPlans.kg] # <kg> is your plan name
family = "Iosevka KG Terminal" # Font menu family name
design = [
"cv08", "cv11", "cv19", "cv43", "cv49", "cv55", "cv62", "cv92",
# `g`, `l`, `y`, `G`, `Q`, `*`, `$` and `%`
"no-ligation"
] # Customize styles
hintParams = ["-a", "sss"] # Optional custom parameters for ttfautohint
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active July 20, 2024 05:29
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@opus-x
opus-x / Spotify_Eliminate_Advertisements
Last active July 21, 2024 05:49
Eliminate Spotify Advertisements + Complete Server List
##################################################################################
# ELIMINATE SPOTIFY ADS (VERSION 1.2 - 8.5) - ABANDONED FOR NOW #
##################################################################################
#
# NOTE: SOMETIMES ONLY ANNOUNCEMENT OF AN AD WHILE USING APP VERSION 7.5-7.9?-8.x.
# USING AN OFFICIAL OLDER VERSION SOLVES THIS. TEST IT (APKMIRROR). THIS WILL NOT
# OCCUR USING CHROMECAST / GOOGLE HOME.
#
# COULD NOT SOLVE THE AUDIO AD INRO/OUTRO IN THE APP.
# SUGGESTIONS? WRITE A COMMENT BELOW.

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.

@mubix
mubix / infosec_newbie.md
Last active July 4, 2024 21:11
How to start in Infosec