Skip to content

Instantly share code, notes, and snippets.

@AdnoC
AdnoC / ginit.vim
Created January 10, 2018 18:09
Open Neovim-Qt windows centered (simpler)
function! s:set_size(...)
" https://github.com/equalsraf/neovim-qt/issues/251
py3 << EOF
import vim
from ctypes import *
u32 = WinDLL('user32.dll')
GetForegroundWindow = u32.GetForegroundWindow
@AdnoC
AdnoC / ginit.vim
Last active August 2, 2018 15:37
Open Neovim-Qt windows centered
function! s:set_size(...)
" https://github.com/equalsraf/neovim-qt/issues/251
py3 << EOF
import vim
from ctypes import *
u32 = WinDLL('user32.dll')
# Parent PID code gotten from
# http://code.activestate.com/recipes/578133-get-parent-process-pid-win32/
def get_parent_pid(pid):
@AdnoC
AdnoC / download_submit370.sh
Created January 15, 2017 02:12
Let you submit EECS370 projects from your local computer
#/bin/sh
# Usage: Download the scripts needed to submit EECS370 projects and modifies them to run.
# The scripts are downloaded to the current directory.
# This script may break if the instructors modify the submission scripts.
# NOTE: You will probably need to download some perl modules to run submit370.
# I got it to work by installing Email::Date::Format
# Using `cpan Email::Date::Format` _should_ have worked, but I couldn't cpan working
# On Ubuntu 14.04 (on Windows Subsystem for Linux) I got it working by calling
call plug#begin('/Users/adno/.config/nvim/bundle')¬
Plug 'Shougo/neosnippet.vim'¬
Plug 'honza/vim-snippets'¬
call plug#end()¬
¬
imap <C-j> <Plug>(neosnippet_expand_or_jump)¬
" smap <C-j> <Plug>(neosnippet_expand_or_jump)¬
xmap <C-j> <Plug>(neosnippet_expand_target)¬
@AdnoC
AdnoC / autoInstallVimPlug.vim
Last active August 29, 2015 14:21
Make sure you always have vim-plug automatically installed. Always.
" gVim looks for plugins in vimfiles instead of .vim in Windows
if has('gui_win32')
let s:vimDirectory=expand("$HOME/vimfiles")
else
let s:vimDirectory=expand("$HOME/.vim")
endif
" Download the manager if it isn't yet.
if empty(glob(expand(s:vimDirectory . '/autoload/plug.vim')))
@AdnoC
AdnoC / gist:ea71f5e95a475339ca90
Last active August 29, 2015 14:07
/r/learnprogramming post part 3
#include<iostream>
using namespace std;
// I had three types of structs. One contained another. That one contained an array of an other as well as a pointer to one.
struct Bar {
int value1;
};
struct Foo {
Bar bars[5];
Bar *next;
};
@AdnoC
AdnoC / gist:6384b7f6cc55f03e5d4e
Last active August 29, 2015 14:07
/r/learnprogramming post part 2
#include<iostream>
using namespace std;
// I had three types of structs. One contained another. That one contained an array of an other as well as a pointer to one.
struct Bar {
int value1;
};
struct Foo {
Bar bars[5];
Bar *next;
};
@AdnoC
AdnoC / gist:cdbba9807853aa2f7605
Last active August 29, 2015 14:07
/r/learnprogramming post part 1
#include<iostream>
using namespace std;
// I had three types of structs. One contained another. That one contained an array of an other as well as a pointer to one.
struct Bar {
int value1;
};
struct Foo {
Bar bars[5];
Bar *next;
};