Skip to content

Instantly share code, notes, and snippets.

@mfuerstenau
mfuerstenau / zigzag-encoding.README
Last active January 1, 2025 19:55
ZigZag encoding/decoding explained
ZigZag-Encoding
---------------
Maps negative values to positive values while going back and
forth (0 = 0, -1 = 1, 1 = 2, -2 = 3, 2 = 4, -3 = 5, 3 = 6 ...)
(i >> bitlength-1) ^ (i << 1)
with "i" being the number to be encoded, "^" being
XOR-operation and ">>" would be arithemtic shifting-operation
@rylev
rylev / learn.md
Created March 5, 2019 10:50
How to Learn Rust

Learning Rust

The following is a list of resources for learning Rust as well as tips and tricks for learning the language faster.

Warning

Rust is not C or C++ so the way your accustomed to do things in those languages might not work in Rust. The best way to learn Rust is to embrace its best practices and see where that takes you.

The generally recommended path is to start by reading the books, and doing small coding exercises until the rules around borrow checking become intuitive. Once this happens, then you can expand to more real world projects. If you find yourself struggling hard with the borrow checker, seek help. It very well could be that you're trying to solve your problem in a way that goes against how Rust wants you to work.

@Fanman03
Fanman03 / UAP-Guide.md
Last active January 1, 2025 19:54
UniFi AP Buyers Guide

UniFi AP Buyers Guide

(updated June 2024)

The APs in this list are ordered from highest to lowest performance. However, unless you have an insane amount of devices you likely do NOT need to buy the most expensive, highest performance AP. You can also check Ebay for deals, especially on older equipment. In terms of best price-to-performance, the U6 Pro/Mesh/InWall series is the sweet spot in my opinion and is the best choice for most deployments.

All APs in this list support both wired backhaul and mesh modes. However, wired connections are strongly recommended for better performance and reliability.

Number of spatial streams are listed in order of 2.4GHz, 5GHz, 6GHz.

Good Choices:

@caendesilva
caendesilva / configure-repository.yml
Created June 19, 2024 17:14
Configure a used repository template to respect export-ignored paths
# When using the Repository Template feature on GitHub, it does not follow the same rules as Composer create-project or ZIP downloads.
# For this reason, we have this script which will configure the repository the first time it is set up in order to normalize it.
name: Configure template repository
on:
# Run when branch is created (when the repository is generated from the template)
create:
# Only keep latest run of this workflow and cancel any previous runs
concurrency:
@nntrn
nntrn / espn-api-list.md
Last active January 1, 2025 19:52
List of nfl api endpoints from espn

List of NFL API Endpoints

This page has been updated a lot in the past 3 years. Older revisions you might like more than this one:

  • June 2021 - list of endpoints for other sports/leagues (i.e. basketball, baseball, lacrosse, rugby)
  • August 2021 - get historical fantasy league data
  • September 2021 - list of endpoints in plain text
  • May 2023 - collapsed endpoint response examples

Additional Resources

@graste
graste / memoryCsv.php
Created June 26, 2020 17:10
handle and test CSV with SplFileObject via in-memory text data - source: https://twitter.com/FredBouchery/status/1276527123172384768
<?php
class MemoryFile extends SplFileObject
{
public function __construct(string $data)
{
parent::__construct('php://memory', 'w+');
$this->fwrite($data);
$this->seek(0);
}
@kirinelf
kirinelf / clock.html
Last active January 1, 2025 19:47 — forked from sam0737/clock.html
OBS Studio: A HTML page for showing current date and time in the video
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>A simple clock</title>
</head>
<body translate="no" >
system.activationScripts.applications.text = let
env = pkgs.buildEnv {
name = "system-applications";
paths = config.environment.systemPackages;
pathsToLink = "/Applications";
};
in
pkgs.lib.mkForce ''
# Set up applications.
echo "setting up /Applications..." >&2
import java.io.*;
public class ReadLineBenchmark {
long volume = 0;
static class StringSlice implements CharSequence {
private final String str;
private final int idx;
private final int end;