Skip to content

Instantly share code, notes, and snippets.

@arsaccol
arsaccol / plugins.vim
Created September 30, 2022 13:35
My current neovim plugins configuration
" ====== here lies vim-plug stuff =======
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'tpope/vim-fugitive'
Plug 'daskol/nvim-bnf', { 'do': 'go install ./cmd/nvim-bnf' }
Plug 'dracula/vim', {'as': 'dracula'}
Plug 'rust-lang/rust.vim'
Plug 'pangloss/vim-javascript'
Plug 'github/copilot.vim'
Plug 'preservim/nerdtree'
@arsaccol
arsaccol / memory-alignment.c
Created May 2, 2021 06:18
Memory alignment demonstration thingie
#include <stddef.h>
#include <stdio.h>
#define STR(x) #x
typedef struct
{
// === funny little waste of memory due to alignment (or lack thereof) ===
// my CPU can only address bytes in multiples of four
// using a non-multiple of 4 number of bytes for the "name" field makes
@arsaccol
arsaccol / init.vim
Created April 21, 2021 05:51
My current neovim config
source ~/.config/nvim/plugins.vim
let mapleader = "-"
set noswapfile
set autoindent
set smartindent
set splitbelow " absolutely
set splitright " blessed
@arsaccol
arsaccol / start-browser-sync.sh
Created January 15, 2021 03:16
Start a browser-sync server where you can develop front-end shit and have it reload automatically in the browser. Use `npm install -g browser-sync` to get it globally installed I guess.
#!/bin/bash
host='localhost'
port=8080
SOCKET_HOST=$host SOCKET_PORT=$port browser-sync start --server --files "./"
@arsaccol
arsaccol / settings.json
Created December 12, 2019 23:46
settings.json file for VS Code. Location in Windows is: <user folder>/AppData/Roaming/Code/User/ Location in Ubuntu is: ~/.config/Code/User/
{
"explorer.confirmDragAndDrop": false,
"explorer.confirmDelete": false,
"workbench.iconTheme": "vscode-icons",
"workbench.tree.indent": 16,
"vsicons.dontShowNewVersionMessage": true,
"files.eol": "\n",
"window.title": "${dirty}${activeEditorMedium}${separator}${rootName}${separator}${appName}",
"window.menuBarVisibility": "default",
"workbench.sideBar.location": "right",
@arsaccol
arsaccol / setup_vim_tmux.sh
Last active April 21, 2022 09:04
Hacky-ass script that sets up vim plugins as well as tmux.conf in newly created virtual machines (or actual machines). Might be buggy but will probably improve my quality of life.
#!/bin/bash
echo 'System is' $OSTYPE
# You should install the following packages before running this script (Debian/Ubuntu names here)
# sudo apt install -y git build-essential cmake python3-dev vim tmux
# Also, installing vim-gtk is a good hacky solution to avoid errors where YouCompleteMe says Python is not supported by vim.
echo 'Installing some stuff which may or may not be essential...'
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
@arsaccol
arsaccol / .vimrc
Last active August 13, 2019 14:38
macOS .vimrc file. Has setup for Vundle, YCM, NERDTree, Omnisharp. I've followed online instructions so I'm not sure if there are redundant configs or something like that. One thing that I have to fix is C-j and C-k conflicting with some YCM or OmniSharp binding(s).
" Begin Vundle stuff
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
" Put plugins here
Plugin 'Valloric/YouCompleteMe'
Plugin 'scrooloose/nerdtree'
@arsaccol
arsaccol / .tmux.conf
Last active September 1, 2022 17:09
Very comfy tmux
# Blessed C-a instead of C-b
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# press "prefix, r" to reload config
bind r source-file ~/.tmux.conf
# press alt-c to create window
bind -n M-c new-window
@arsaccol
arsaccol / clean.bat
Last active November 20, 2018 05:15
Arquivos .bat para conveniência no trabalho do Intel. O montador, linker e debugger devem ficar em "C:\ferramentas" (tal como entendido pelo DOSBox). PORÉM, é recomendável que arquivos .bat aqui descritos residam em outra pasta, juntamente com o código do trabalho, sob risco de apagarem os arquivos .exe dos próprios montador e linker.
:: Apaga residuos de montagem/linkagem anterior
:: Uso: C:\>clean
:: Cuidado para nao executar dentro da pasta C:\ferramentas e apagar os proprios montador e linker
@echo off
del *.EXE
del *.LST
del *.MAP
del *.OBJ
@arsaccol
arsaccol / makefile
Last active October 23, 2018 12:41
Sample, generic-ish makefile with some SFML libraries being linked; pretty much copied this from some tutorial so I don't quite claim authorship. This makefile will generate one object file for every .cpp file without any regard for dependencies and then link them all together, so watch that you don't run an executable that was linked with outda…
CC = g++
CFLAGS = -std=c++11 -Wextra
LDFLAGS= -lsfml-graphics -lsfml-window -lsfml-system
EXEC = executable
SOURCES = $(wildcard *.cpp)
OBJECTS = $(SOURCES:.cpp=.o)
$(EXEC): $(OBJECTS)
$(CC) $(OBJECTS) -o $(EXEC) $(LDFLAGS)