brew install neovim/neovim/neovim
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
| html.material { | |
| --white: #202B31; | |
| --ghostwhite: #2d3d46; | |
| --lightgrey: #28353B; | |
| --altgrey: #2B3E41; | |
| --grey: #303F47; | |
| --darkgrey: #617E8A; | |
| --lightblack: #455a64; | |
| --black: #99B1B7; | |
| --green: #900F3C; |
Playlists for each of the current Vinyl Moon releases. Songs that aren't available on Spotify have been skipped.
This file contains hidden or 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 MyApp.Redis do | |
| @moduledoc "State management using redis for persistence" | |
| alias MyApp.Redis.Connection | |
| @doc "Starts the redis conection and registers the process" | |
| def start_link(redis_connection_string \\ "redis://localhost") do | |
| Redix.start_link(redis_connection_string, name: MyApp.Redis.Connection) | |
| end | |
| @doc "Sets a value to a key in redis" |
