Skip to content

Instantly share code, notes, and snippets.

View Pebaz's full-sized avatar
🐝
Typing Rapidly

Pebaz Pebaz

🐝
Typing Rapidly
View GitHub Profile

💰➡️🍕

Tether USDT

TRC20 Tron Network

TPfjb2mbSQQwUe9AScZmu5bRax3dHdBBiL

BEP20 Binance Smart Chain Network BSC

@Kestrer
Kestrer / how-to-write-hygienic-macros.md
Created October 17, 2020 05:35
A guide on how to write hygienic Rust macros

How to Write Hygienic Rust Macros

Macro hygiene is the concept of macros that work in all contexts; they don't affect and aren't affected by anything around them. Ideally all macros would be fully hygienic, but there are lots of pitfalls and traps that make it all too easy to accidentally write unhygienic macros. This guide attempts to provide a comprehensive resource for writing the most hygienic macros.

Understanding the Module System

First, a little aside on the details of Rust's module system, and specifically paths; it is

@tiebingzhang
tiebingzhang / simple-tcp-client.c
Last active March 6, 2022 10:12
A simple TCP client in C
#include <stdio.h>
#include <unistd.h>
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#define PORT 8080
@tiebingzhang
tiebingzhang / simple-tcp-server.c
Created June 7, 2019 20:02
A basic tcp server in C
#include <stdio.h>
#include <unistd.h>
#include <netdb.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <errno.h>
@fnky
fnky / ANSI.md
Last active November 3, 2024 21:31
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@longtimeago
longtimeago / squash-commits.md
Last active April 1, 2024 20:44
How to squash commits in a GitHub pull request

How to squash commits in a GitHub pull request

o you've contributed some code to an open source project, say, Rails. And they'd like you to squash all of the commits in your pull request. But you're not a git wizard; how do you make this happen?

Normally, you'd do something like this. I'm assuming upstream is a git remote that is pointing at the official project repository, and that your changes are in your 'omgpull' branch:

@hosaka
hosaka / README.md
Last active February 3, 2022 08:12
Abstract Data Type using opaque pointers in C

Compile and run

gcc adt.c array.c -o adt
./adt