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:3.6-stretch as python-base | |
| COPY webpack requirements.txt package.json yarn.lock ./ | |
| RUN set -ex \ | |
| && apt-get update \ | |
| && apt-get install apt-transport-https \ | |
| && apt-get update \ | |
| && apt-get install --no-install-recommends -y \ | |
| libpq-dev curl libjpeg-dev rsync libsass-dev libicu57 zlib1g-dev libpng-dev libmagickwand-dev \ |
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
| (comment "This is a small experiment inspired by Oskar Wickströms | |
| excellent work at | |
| https://haskell-at-work.com/episodes/2018-01-19-domain-modelling-with-haskell-data-structures.html. | |
| I wanted to see what would be involved in building the equivalent | |
| functionality in reasonably ideomatic Clojure. It is also my first | |
| from scratch use of Clojure spec, which was a very interesting and | |
| productive experience. It is amazing how little work one has to do | |
| to be able to generate example datastructures for testing. The | |
| generated examples helped me find a subtle bug in the tree pretty | |
| printer, that would have been hard to find without." "I would love |
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:3.6 | |
| COPY requirements.txt . | |
| COPY package.json . | |
| WORKDIR /app/ | |
| ADD . /app/ | |
| RUN set -ex \ | |
| && apt-get update \ |
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
| getNavStates(indx, length) { | |
| let styles = []; | |
| for (let i=0; i<length; i++) { | |
| if (i < indx) { | |
| styles.push('done'); | |
| } | |
| else if (i === indx) { | |
| styles.push('doing'); | |
| } |
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
| // Mutex implementation originally taken from https://github.com/mgtitimoli/await-mutex | |
| /* Why do you need mutexes in a single threaded context ? | |
| * Presumably instances of `MyObject` can be accessed by functions which are running while this function is suspended, | |
| * waiting for the network call. It's single threaded, as in only one thing happens at a time from JS's point of view, | |
| * but other functions can be invoked (by a request coming in, or a UI event etc) while an asynchronous operation | |
| * is awaiting completion. | |
| */ | |
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 Main (..) where | |
| import Effects exposing (Effects, Never) | |
| import Html exposing (..) | |
| import Html.Attributes exposing (style) | |
| import Html.Events exposing (onClick) | |
| import Http | |
| import Json.Decode as Decode exposing ((:=)) | |
| import Json.Decode.Extra exposing ((|:)) | |
| import Task |
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
| Please read original blog post for reference: | |
| http://blog.process-one.net/embedding-ejabberd-into-an-elixir-phoenix-web-application/ |
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
| Users.newusers | |
| |> elem(1) | |
| |> Map.get("Items") | |
| |> Poison.encode | |
| |> elem(1) | |
| |> File.write("/dir/users.json") | |
| #response from dynamodb after first function |
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
| <?php | |
| /* | |
| Template Name: Experiences List | |
| */ | |
| get_header(); | |
| ?> | |
| <div id="primary" class="content-area"> | |
| <main id="main" role="main"> | |
| <div class="experiences"> |
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
| iex(1)> decode = "bm9uY2U9Y2JlYTQ1NGQyYjNiYmQyZTI1OTQ2YzNkYT\nViOTM5OWYmcmV0dXJu\nX3Nzb191cmw9aHR0cCUzQSUyRiUyRmZvcnVtcy5zdHJpbmdpZnkuY29tJTJG\nc2Vzc2lvbiUyRnNzb19sb2dpbg==\n" | |
| "bm9uY2U9Y2JlYTQ1NGQyYjNiYmQyZTI1OTQ2YzNkYT\nViOTM5OWYmcmV0dXJu\nX3Nzb191cmw9aHR0cCUzQSUyRiUyRmZvcnVtcy5zdHJpbmdpZnkuY29tJTJG\nc2Vzc2lvbiUyRnNzb19sb2dpbg==\n" | |
| iex(2)> Base.decode64! decode | |
| ** (ArgumentError) non-alphabet digit found: | |
| (elixir) lib/base.ex:111: Base.dec64/1 | |
| (elixir) lib/base.ex:518: Base."-do_decode64/2-lbc$^0/2-0-"/3 | |
| (elixir) lib/base.ex:518: Base.do_decode64/2 | |
| iex(2)> Base.url_decode64! decode | |
| ** (ArgumentError) non-alphabet digit found: |