Skip to content

Instantly share code, notes, and snippets.

@ityonemo
ityonemo / test.md
Last active July 19, 2024 06:53
Zig in 30 minutes

A half-hour to learn Zig

This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/

Basics

the command zig run my_code.zig will compile and immediately run your Zig program. Each of these cells contains a zig program that you can try to run (some of them contain compile-time errors that you can comment out to play with)

@enricofoltran
enricofoltran / main.go
Last active June 26, 2024 12:16
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@LiquidFenrir
LiquidFenrir / common.h
Last active June 4, 2017 15:55
simple filebrowser for 3ds
#pragma once
#include <3ds.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdbool.h>
// according to wikipedia, the max FAT32 path length is 255 UTF-16 characters, so 0xFF * 2 (because the 16 in UTF-16 means 16 bits = 2 bytes) (shifting left of 1 is the same as multiplying by 2)
@zacharycarter
zacharycarter / wclwn.md
Last active July 6, 2024 06:26
Binding to C Libraries with Nim
@joepie91
joepie91 / random.md
Last active July 13, 2024 16:15
Secure random values (in Node.js)

Not all random values are created equal - for security-related code, you need a specific kind of random value.

A summary of this article, if you don't want to read the entire thing:

  • Don't use Math.random(). There are extremely few cases where Math.random() is the right answer. Don't use it, unless you've read this entire article, and determined that it's necessary for your case.
  • Don't use crypto.getRandomBytes directly. While it's a CSPRNG, it's easy to bias the result when 'transforming' it, such that the output becomes more predictable.
  • If you want to generate random tokens or API keys: Use uuid, specifically the uuid.v4() method. Avoid node-uuid - it's not the same package, and doesn't produce reliably secure random values.
  • If you want to generate random numbers in a range: Use random-number-csprng.

You should seriously consider reading the entire article, though - it's

@SirTony
SirTony / Fallout 4 Save File Format.md
Last active July 24, 2024 00:50
The binary format for Fallout 4 PC save files.

Fallout 4 Save File Format

The binary format for Fallout 4 PC save files. This document was created by reverse-engineering files from version 1.2.37.0 of the game.

Note: This document is incomplete!

Table of Contents

@mid-kid
mid-kid / Dummy RSF
Last active July 23, 2023 20:07
Dummy .rsf file for 3DS games
Dummy .rsf file for 3DS games
@ProjectCleverWeb
ProjectCleverWeb / centered.md
Last active September 20, 2023 09:46
Example of how to do centered text and images in Githb Flavored Markdown
@shrayasr
shrayasr / update-sidebar-praw.md
Last active August 9, 2020 08:33
Updating sidebar content with PRAW

Updating reddit sidebar content with PRAW

PRAW is the AWESOME Reddit API Wrapper written in Python.

Download PRAW

pip install praw

Import PRAW