Skip to content

Instantly share code, notes, and snippets.

Gregory L. Wagner glwagner

Block or report user

Report or block glwagner

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
@glwagner
glwagner / .vimrc
Last active Nov 24, 2018
My .vimrc for a MacbookPro running OSX 10.14 Mojave
View .vimrc
" glw's .vimrc for a MacBook pro
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
@glwagner
glwagner / .vimrc
Last active Mar 19, 2018
My Ubuntu vimrc with a few humble settings and keymappings.
View .vimrc
set nocompatible
filetype off
" Set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'JuliaEditorSupport/julia-vim'
@glwagner
glwagner / speedtest_simpleops.jl
Last active Dec 10, 2017
A small script to test the speed of simple operations in julia
View speedtest_simpleops.jl
function broadcastmult!(A, x, F; nloops=1000)
for i = 1:nloops
@. A = x*F
end
end
function regularmult!(A, X, F; nloops=1000)
for i = 1:nloops
@. A = X*F
end
@glwagner
glwagner / .vimrc_digraphs
Created Dec 5, 2017
Code for .vimrcs that defines digraphs for unicode alphabetic subscripts
View .vimrc_digraphs
" Define digraphs for alphabetic subscripts in .vimrc
execute "digraphs ks " . 0x2096
execute "digraphs as " . 0x2090
execute "digraphs es " . 0x2091
execute "digraphs hs " . 0x2095
execute "digraphs is " . 0x1D62
execute "digraphs ks " . 0x2096
execute "digraphs ls " . 0x2097
execute "digraphs ms " . 0x2098
execute "digraphs ns " . 0x2099
@glwagner
glwagner / julia.vim
Last active Jun 5, 2017
Julia syntax file for vim.
View julia.vim
" Vim syntax file
" Language: julia
" Maintainer: Carlo Baldassi <carlobaldassi@gmail.com>
" Last Change: 2013 feb 11
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
@glwagner
glwagner / linecounter.py
Last active Jun 3, 2017
Provides a python function with an associated generator object that rapidly counts line in a specified text file. This method only works in python 3.
View linecounter.py
def linecount_generator(reader):
"""Yield a generator object for the purpose of counting lines in a file
at speed. See
https://stackoverflow.com/questions/
845058/how-to-get-line-count-cheaply-in-python/27518377#27518377
"""
b = reader(1024*1024)
while b:
yield b
b = reader(1024*1024)
@glwagner
glwagner / .vimrc
Last active Mar 30, 2017
My Mac vimrc with a few humble keymappings and color changes to vim syntax groups.
View .vimrc
" Line numbers.
set number
" Syntax highlighting.
syntax on
" Convert tab key to insert four spaces.
set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab
" Remove extremely annoying red boxes that appears in
You can’t perform that action at this time.