Skip to content

Instantly share code, notes, and snippets.

@darkwater
darkwater / main.lua
Created March 5, 2019 18:53
part of game prototype
function bullet_new(opts)
local bullet = {
position = opts.position,
momentum = opts.momentum,
radius = opts.radius,
orientation = 0,
color = { 230, 200, 30, 240 },
}
function bullet:update(dt)
@darkwater
darkwater / init.vim
Created October 5, 2018 11:56
Neovim config
""
"" Darkwater's Neovim configuration
""
" Plugins {{{
call plug#begin()
" UI plugins
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'majutsushi/tagbar', { 'on': 'Tagbar' }
@darkwater
darkwater / vscodevim.md
Last active August 29, 2018 02:36
stuff vscodevim lacks that i noticed, some of which i really missed

" doesn't work in visual block mode
. also repeats cursor movement during visual
:e is relative to current file instead of project root
:e raises error for new files
= needs a syntax-specific formatter; doesn't fall back to a generic one
>2} doesn't work
M behaves incorrectly when scrolled past the bottom of the file
Vp after yy to replace a line inserts a blank line above
^D and ^U scroll without moving cursor
^O and ^I cycle through small movements

@darkwater
darkwater / monty-hall.rs
Last active May 16, 2017 07:46
Simulates the Monty Hall problem
// Run with two arguments: strategy and simulations
//
// eg.
// cargo run stay 500
// cargo run switch 10000
extern crate rand;
use rand::Rng;
use std::env;