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 prints an overview of all lines of code inside a Elixir project | |
# + gives a indication on how much code exists in tests vs production code | |
SLOC_TOTAL=0 | |
TLOC_TOTAL=0 | |
echo "Umbrella lines of code overview" | |
for APP in `ls apps/` | |
do | |
SLOC=$(find apps/${APP}/lib -type f -name '*.ex*' -print0 | xargs -0 wc -l | tail -n 1 | awk '{print $1}') |
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(mooc). | |
-export([xOr1/2, xOr2/2, xOr3/2]). | |
-export([maxThree/3]). | |
-export([howManyEqual/3]). | |
-export([test/0]). | |
xOr1(X, Y) -> | |
(not X == Y) and (X or Y). |
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(first). | |
-export([double/1, mult/2, area/3, square/1, treble/1]). | |
mult(X, Y) -> | |
X * Y. | |
double(X) -> | |
mult(2, X). |
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 Parser do | |
@moduledoc """ | |
Sample parser for article on: | |
http://stefan.lapers.be/posts/elixir-writing-an-expression-parser-with-nimble-parsec/ | |
""" | |
import NimbleParsec | |
not_ = string("!") |> label("!") | |
and_ = string("&&") |> replace(:&&) |> label("&&") | |
or_ = string("||") |> replace(:||) |> label("||") |
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 WorkStep do | |
defstruct [:name, :in, :out, :mod, :fun, :arg] | |
require Logger | |
def add_to_graph(%Graph{} = graph, %__MODULE__{} = step) do | |
graph | |
|> Graph.add_vertex(step) | |
|> Graph.add_edges(step |> edges_in) | |
|> Graph.add_edges(step |> edges_out) | |
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
Fri Jun 16 12:39:30 UTC 2017 |
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
FROM python:2 | |
RUN \ | |
echo " ------ UPDATING AND INSTALLING SYSTEM DEPENDENCIES ------" \ | |
&& apt-get update \ | |
&& apt-get upgrade -y \ | |
&& apt-get install -y \ | |
python-numpy \ | |
python-opencv \ | |
git \ |
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 App.UiModal exposing (..) | |
import Html exposing (..) | |
import Html.Attributes exposing (..) | |
import Html.Events exposing (..) | |
type alias Modal = | |
{ content : Maybe String | |
} |
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
#!/bin/bash | |
IMAGES=$(docker images --format "{{.Repository}}" | sort | uniq) | |
for IMAGE in ${IMAGES}; do | |
OLD=$(docker images ${IMAGE} --format "{{.ID}}" | tail -n +10) | |
docker rmi ${OLD} | |
done |