Instantly share code, notes, and snippets.

View quote.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Quote</title>
<link href="https://fonts.googleapis.com/css?family=Spectral" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Merriweather" rel="stylesheet">
<style>
textarea {
width: 600px;
View bootstrap-vim.md

Bootstrapping Vim

  1. Install vim-plug
    curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
        https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
    
  2. Clone .vimrc
  3. vim +PlugInstall +qall
  4. In Vim :Obsess ~/.vim/mysession.vim
View .vimrc
" Plug: https://github.com/junegunn/vim-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'
View main.rs
extern crate rand;
use rand::Rng;
const ROWS: usize = 10;
const COLS: usize = 80;
const ANSI_COLOR_RED: &str = "\x1b[31m";
const ANSI_COLOR_GREEN: &str = "\x1b[32m";
const ANSI_COLOR_BLUE: &str = "\x1b[34m";
View ruby.html
<!doctype html>
<html lang=en>
<head>
<meta charset=utf-8>
<title>Ruby</title>
</head>
<body>
<p>
<ruby>
明日 <rp>(</rp><rt>Ashita</rt><rp>)</rp>
View gameboy_opcodes.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<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;
View disassembler.c
#include <stdlib.h>
#include <stdio.h>
// Started from http://emulator101.com/
int disassemble_op(unsigned char *codebuffer, int pc)
{
unsigned char *code = &codebuffer[pc];
int opbytes = 1;
View postgres-table-bloat.md

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.

DROP TABLE IF EXISTS users;
CREATE TABLE users (name varchar(80)) WITH OIDS;
INSERT INTO users VALUES ('root');
SELECT oid, xmin, xmax, name FROM users;
View main.c
#include <stdio.h>
#include <unistd.h>
#include <sys/socket.h>
#include <msgpack.h>
/*
* $ NVIM_LISTEN_ADDRESS=127.0.0.1:8888 nvim
*
*/
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.