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
// Mac ~/Library/Application Support/Code/User/keybindings.json | |
[ | |
{ | |
"key": "alt+enter", | |
"command": "workbench.action.terminal.runSelectedText" | |
}, | |
{ | |
"key": "cmd+h", | |
"command": "editor.action.startFindReplaceAction" | |
}, |
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
# Until StreamData ships in Elixir it needs to be added as a dependency. | |
# https://hexdocs.pm/stream_data/StreamData.html#content | |
# https://hex.pm/packages/stream_data | |
# Add this to your mix.exs deps... | |
# {:stream_data, "~> 0.4.2"} | |
defmodule ColorNameTest do | |
use ExUnit.Case, async: true | |
use ExUnitProperties |
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 UnitsOfMeasure | |
[<Measure>] type cm | |
[<Measure>] type inch | |
type Shape<[<Measure>]'u> = | |
| Circle of float<'u> | |
| Square of float<'u> | |
| Triangle of float<'u> * float<'u> | |
| Rectangle of float<'u> * float<'u> |
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 UnionTypes | |
// Learn more about F# at http://fsharp.org | |
type Shape = | |
| Circle of float | |
| Square of float | |
| Triangle of float * float | |
| Rectangle of float * float |
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
Interactive Elixir (1.5.1) - press Ctrl+C to exit (type h() ENTER for help) | |
iex(1)> defmodule Bangpipe do | |
...(1)> defmacro left <|> right do | |
...(1)> quote do | |
...(1)> unquote(left) | |
...(1)> |> case do | |
...(1)> {:ok, val} -> val | |
...(1)> val -> val | |
...(1)> end | |
...(1)> |> unquote(right) |
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 sample shows connecting to a sample Phoenix chat application running locally. | |
// The sample Phoenix app was written by Chris McCord and can be found here: | |
// https://github.com/chrismccord/phoenix_chat_example) | |
// #r @".\packages\WebSocketSharp.1.0.3-rc11\lib\websocket-sharp.dll" | |
open WebSocketSharp | |
let ws = new WebSocket("ws://localhost:4000/socket/websocket") | |
ws.OnOpen.Add(fun args -> System.Console.WriteLine("Open")) |
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 Bumper do | |
@doc ~S""" | |
Reads a Bitmap (24-bit) and displays width, height, and the RGB of each pixel | |
""" | |
def show(filename) do | |
{:ok, bindata} = File.read(filename) | |
<< "BM", | |
_::size(64), | |
offset_to_pixels::size(32)-little, |
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
# Show all Pids on local node with at least one message queued in its mailbox | |
Process.list |> Enum.filter(&(Process.info(&1)[:message_queue_len] >0)) | |
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
## Functional Track talks from NDC London 2014 | |
### Wednesday 2014-12-3 | |
* [F-Words - Functional Programming Terms With More Than Four Letters - Calvin Bottoms](http://www.ndcvideos.com/#/app/video/2191) | |
* [Reactive Game Development For The Discerning Hipster - Bodil Stokke](http://www.ndcvideos.com/#/app/video/2221) | |
* [Erlang Patterns Matching Business Needs -- Torben Hoffman](http://www.ndcvideos.com/#/app/video/2211) | |
* [Equivalence Classes, xUnit.net, FsCheck, Property-Based Testing -- Mark Seemann](http://www.ndcvideos.com/#/app/video/2291) | |
* [Functional programming design patterns -- Scott Wlaschin](http://www.ndcvideos.com/#/app/video/2311) | |
* [Write Your Own Compiler in 24 Hours -- Phillip Trelford](http://www.ndcvideos.com/#/app/video/2281) |
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
# Copyright 2012 Erlware, LLC. All Rights Reserved. | |
# | |
# This file is provided to you under the Apache License, | |
# Version 2.0 (the "License"); you may not use this file | |
# except in compliance with the License. You may obtain | |
# a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, |
NewerOlder