Skip to content

Instantly share code, notes, and snippets.

View mjs2600's full-sized avatar

Michael Simpson mjs2600

View GitHub Profile
defmodule Fizzbuzz do
def parse(range \\ 1..100) do
range
|> Enum.map(&parse_num/1)
|> Enum.join
end
defp parse_num(n) do
fizzbuzzer(n, rem(n, 3), rem(n, 5))
end
@mjs2600
mjs2600 / init.vim
Created July 7, 2017 13:49
My `.vimrc`
if !filereadable(glob("~/.config/nvim/autoload/plug.vim"))
!curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
endif
let g:python_host_prog = $HOME . '/.pyenv/versions/neovim2/bin/python'
let g:python3_host_prog = $HOME . '/.pyenv/versions/neovim3/bin/python'
let mapleader = ' '
silent !mkdir -p ~/.vim/undo > /dev/null 2>&1
@mjs2600
mjs2600 / init.vim
Last active March 5, 2019 17:47
vimrc
if !filereadable(glob("~/.config/nvim/autoload/plug.vim"))
!curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
endif
let g:clipboard = {
\ 'name': 'pbcopy',
\ 'copy': {
\ '+': 'pbcopy',
\ '*': 'pbcopy',
\ },
@mjs2600
mjs2600 / theme.fish
Created April 9, 2018 12:46
My Fish Theme
# Theme based on Bira theme from oh-my-zsh: https://github.com/robbyrussell/oh-my-zsh/blob/master/themes/bira.zsh-theme
# Some code stolen from oh-my-fish clearance theme: https://github.com/bpinto/oh-my-fish/blob/master/themes/clearance/
function __user_host
set -l content
if [ (id -u) = "0" ];
echo -n (set_color --bold red)
else
echo -n (set_color --bold green)
end
@mjs2600
mjs2600 / ComponentCounter.re
Created June 8, 2018 19:59
ReasonML Counter
type state = {count: int};
type action =
| Increment
| Decrement;
let component = ReasonReact.reducerComponent("State");
let make = _children => {
...component,