Skip to content

Instantly share code, notes, and snippets.

Saulo Silva ssilva

Block or report user

Report or block ssilva

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
# Simple, ad-hoc script to quickly bootstrap a fresh Vim install.
echo -n "This will overwrite your .vimrc and plugins. Do you wish to continue [y/N]? "
read answer
if ! echo "$answer" | grep -iq "^y"; then
View .vimrc
execute pathogen#infect()
"execute pathogen#helptags()
" Suggested Pathogen plugins
View aws-s3-bucket-policy.json
"Principal": "*",
ssilva / coding-style.rst
Created Sep 4, 2017
Linux kernel coding style
View coding-style.rst

Linux kernel coding style

This is a short document describing the preferred coding style for the linux kernel. Coding style is very personal, and I won't force my views on anybody, but this is what goes for anything that I have to be able to maintain, and I'd prefer it for most other things too. Please at least consider the points made here.

ssilva / main.c
Last active Sep 12, 2017
msgpack neovim c client proof of concept
View main.c
#include <stdio.h>
#include <unistd.h>
#include <sys/socket.h>
#include <msgpack.h>

In Postgres, each row has a system column xmin which holds the ID of the first transaction to have visibility over that row. Conversely, the xmax system column holds the ID of last trasaction to have visibility over that row.

CREATE TABLE users (name varchar(80)) WITH OIDS;
INSERT INTO users VALUES ('root');
SELECT oid, xmin, xmax, name FROM users;


Sum of numbers

Pipe to awk '{s+=$1} END {print s}' or paste -s -d+ - | bc (here paste joins the numbers into one line)


  • { extends the selection until the next empty line


View gameboy_opcodes.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<title>Gameboy (LR35902) OPCODES</title>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
<style type="text/css"> <!--
table.withborder {
border-width: 1px;
border-style: solid;
ssilva / disassembler.c
Last active Jul 17, 2018
8080 emulation
View disassembler.c
#include <stdlib.h>
#include <stdio.h>
// Started from
int disassemble_op(unsigned char *codebuffer, int pc)
unsigned char *code = &codebuffer[pc];
int opbytes = 1;
ssilva / .vimrc
Created Jul 19, 2018
.vimrc using Plug
View .vimrc
" Plug:
call plug#begin('~/.vim/plugged')
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-obsession'
Plug 'tpope/vim-sensible'
Plug 'tpope/vim-markdown'
Plug 'itchyny/lightline.vim'
Plug 'terryma/vim-multiple-cursors'
Plug 'airblade/vim-gitgutter'
Plug 'chriskempson/base16-vim'
You can’t perform that action at this time.