Skip to content

Instantly share code, notes, and snippets.

View luizfernandonb's full-sized avatar

Luiz luizfernandonb

View GitHub Profile
@agutoli
agutoli / hello.S
Created September 25, 2012 20:42
Hello world em assembly
; Exemplo de um Hello World em Assembly
; ld -m elf_i386 -s -o hello hello.o
section .text align=0
global _start
mensagem db 'Hello world', 0x0a
len equ $ - mensagem
@aprell
aprell / va_nargs.c
Last active August 8, 2024 02:04
Counting arguments in variadic macros
// RUN: cc -Wall -Wextra %s && ./a.out
#include <assert.h>
#if defined(__GNUC__) || defined(__clang__)
// Supports 0-10 arguments
#define VA_NARGS_IMPL(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...) N
// ## deletes preceding comma if _VA_ARGS__ is empty (GCC, Clang)
#define VA_NARGS(...) VA_NARGS_IMPL(_, ## __VA_ARGS__, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)
#else
@yohhoy
yohhoy / threads.h
Last active February 15, 2025 21:51
C11 <threads.h> emulation library
/*
* C11 <threads.h> emulation library
*
* (C) Copyright yohhoy 2012.
* Distributed under the Boost Software License, Version 1.0.
* (See copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef EMULATED_THREADS_H_INCLUDED_
#define EMULATED_THREADS_H_INCLUDED_
@millermedeiros
millermedeiros / .vimrc
Last active March 20, 2025 08:53
My VIM settings (.vimrc)
" =============================================================================
" Miller Medeiros .vimrc file
" -----------------------------------------------------------------------------
" heavily inspired by: @factorylabs, @scrooloose, @nvie, @gf3, @bit-theory, ...
" =============================================================================
" -----------------------------------------------------------------------------
" BEHAVIOR
@heronmedeiros
heronmedeiros / .vimrc
Created August 1, 2011 19:03 — forked from henriquegogo/.vimrc
Meu arquivo de configuração .vimrc do Vim
""""""""""""""""""""""""""""""""""""""""
" CONFIGURAÇÕES GOGS - WWW.GOGS.COM.BR "
""""""""""""""""""""""""""""""""""""""""
set number " Numera as linhas
set linebreak " Quebra a linha sem quebrar a palavra
set nobackup " Não salva arquivos de backup~
set wildmode=longest,list " Completa o comando com TAB igual o bash
set ignorecase " Ignora o case sensitive nas buscas
set smartcase " Se tiver alguma letra maiúscula, ativa o case sensitive
set gdefault " Sempre substitui todas as palavras, não só a primeira
@kylef
kylef / dict.c
Created March 27, 2009 17:11
A key/value dictionary system in C
/* A key/value dict system in C */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define TEST TRUE /* Comment this line out to compile without a main function (used when including into another application). */
typedef struct dict_t_struct {
char *key;
void *value;