Skip to content

Instantly share code, notes, and snippets.

View MilesCranmer's full-sized avatar

Miles Cranmer MilesCranmer

View GitHub Profile
@MilesCranmer
MilesCranmer / .vimrc
Created July 6, 2020 14:37 — forked from yk/.vimrc
vimrc july 2020
set nocompatible " be iMproved, required
let g:python3_host_prog = '/usr/local/opt/python@3.8/bin/python3.8'
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin('~/.vim/plugged')
@MilesCranmer
MilesCranmer / writings-tracking-with-git.bash
Created June 11, 2020 10:37 — forked from markwk/writings-tracking-with-git.bash
My Writings Tracker with Git: A bash script for tracking my writings in plain tex files, calculate stats like word count, hashtags and new files, store stats to csv and commit to git.
#!/bin/bash
##################################
#
# THE ARCHIVE TRACKER
#
# REF: https://gist.github.com/markwk/c85a8a72bc8c03d0f510262bb5219a34/
#
# INTRODUCTION:
# Daily script to navigate to a directory of plain text files,
# add files to git repo, calculate key stats, store stats to csv
@MilesCranmer
MilesCranmer / numpy_cffi_arrays.py
Created January 29, 2018 00:18 — forked from arjones6/numpy_cffi_arrays.py
Passing multidimensional numpy arrays to C using cffi.
import numpy
from cffi import FFI
ffi = FFI()
ffi.cdef("""
void single_test(double *x, int n);
void multi_test(double **x, int n, int m);
""")
C = ffi.dlopen("./simple.so")