Skip to content

Instantly share code, notes, and snippets.

View Dauie's full-sized avatar
🛠️
wurk

Robert Wyatt Lutt Dauie

🛠️
wurk
  • Metahobby
  • Fremont, CA
View GitHub Profile
@eevee
eevee / perlin.py
Last active March 2, 2024 08:48
Perlin noise in Python
"""Perlin noise implementation."""
# Licensed under ISC
from itertools import product
import math
import random
def smoothstep(t):
"""Smooth curve with a zero derivative at 0 and 1, making it useful for
interpolating.
@alanzeino
alanzeino / lldb-debugging.md
Last active April 28, 2024 10:21
LLDB debugging with examples

LLDB Debugging Cheat Sheet

Commands

LLDB Commands

LLDB comes with a great set of commands for powerful debugging.

help

Your starting point for anything. Type help to get a list of all commands, plus any user installed ones. Type 'help for more information on a command. Type help to get help for a specific option in a command too.

@hailinzeng
hailinzeng / htonll.c
Last active October 6, 2018 04:21
convert host order uint64_t to network order uint64_t
#include <sys/param.h>
uint64_t htonll(uint64_t n)
{
#if __BYTE_ORDER == __BIG_ENDIAN
return n;
#else
return (((uint64_t)htonl(n)) << 32) + htonl(n >> 32);
#endif
}
@twslankard
twslankard / getaddrinfo.c
Created May 31, 2011 20:24
getaddrinfo / inet_ntop example
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <arpa/inet.h>
#include <netdb.h>
int main(int argc, char * argv[]) {
struct addrinfo * _addrinfo;
struct addrinfo * _res;