brew install neovim/neovim/neovim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule FlattenedMap do | |
def flatten(%{} = map) do | |
map |> Enum.map(&merge/1) |> List.flatten |> Enum.into(%{}) | |
end | |
defp merge({prefix, %{} = map}), do: Enum.map(map, &do_merge(prefix, &1)) | |
defp merge(flat), do: flat | |
defp do_merge(prefix, {key, val}), do: merge({merge_keys(prefix, key), val}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setup_jruby() { | |
export JRUBY_HOME=/usr/ruby/jruby9 | |
export PATH=$PATH:$JRUBY_HOME/bin | |
export JAVA_HOME=/usr/java/java8 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Sequence do | |
def fib(0), do: 1 | |
def fib(1), do: 1 | |
def fib(n), do: fib(n-2) + fib(n-1) | |
def map([],_f), do: [] | |
def map([head|tail], f) do | |
[f.(head) | map(tail,f)] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'minitest/spec' | |
require 'minitest/autorun' | |
class Solve | |
attr_reader :expected, :numbers | |
def initialize expected, *numbers | |
@expected = expected | |
@numbers = numbers | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_=$$/$$;__=_-_;@_=_+_;$_=@_+_;$-=@_+$_;$-_=$-*$_ | |
@__ =''<<$-_*($-+$_)+@_ | |
$___=''<<$-_*$--$-<<$-_*($-+@_)<<@__<<@__ | |
@___=''<<$-_*$--$_*$_<<$-_*($-+$_)-$_<<@__<<@__ | |
(___=->{$.+=_;$><<($.%$-_==__ ?$___+@___:$.%$_==__ ?$___:$.% | |
$-==__ ?@___:$.)<<(''<<$-*@_);$.<($-*@_)**@_?___[]:_})[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ImmutableContentFor | |
def immutable_content_for label, &block | |
content_for label, &block unless content_for? label | |
end | |
def cached_immutable_content_for key, label, &block | |
Rails.cache.write key, block.call unless content_for? label | |
immutable_content_for label, &block | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hello from vim!!! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdbool.h> | |
#include <string.h> | |
bool is_vowel(char arg) { | |
int i; | |
char vowels[] = "aeiou"; | |
if(arg < 91) arg += 32; | |
for (i = 0; i < strlen(vowels); ++i) { | |
if (arg == vowels[i]) return true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# g: with no args: runs short status | |
# with args: acts as `git` | |
function g () { | |
if [[ $# > 0 ]] | |
then | |
git $@ | |
else | |
git status -sb | |
fi | |
} |