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
port module Main exposing (main) | |
import Browser | |
import Html exposing (Html, button, canvas, div, h1, h3, p, text) | |
import Html.Attributes exposing (class, height, id, width) | |
import Html.Events exposing (onClick) | |
port subscribeToVideoUpdates : () -> Cmd msg |
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
{-# LANGUAGE RankNTypes #-} | |
module Optics where | |
import Control.Category ((>>>)) | |
import qualified Control.Category as Cat | |
import Control.Effect.Empty | |
import Control.Effect.NonDet hiding (empty) | |
import Control.Monad ((<=<)) | |
-- riffing off of @serras’s post https://gist.github.com/serras/5152ec18ec5223b676cc67cac0e99b70 |
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 Codewars.Kata.DecodeMorse (decodeMorse) where | |
import Codewars.Kata.DecodeMorse.Preload (morseCodes) | |
import Data.List.Split (splitOn) | |
import Data.Map.Strict ((!)) | |
decodeMorse :: String -> String | |
decodeMorse = unwords . filter (not . null) . map ((>>= (morseCodes!)) . words) . splitOn " " |
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 exposing (main) | |
import Dict | |
import Html exposing (Html) | |
import Html.Attributes exposing (attribute, property) | |
import Json.Encode as Encode | |
main : Html msg | |
main = | |
Html.node "google-calendar" | |
[ attribute "type" "calendar" |
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 exposing (..) | |
import Browser | |
import Html exposing (Html, div, h1, input, p, text) | |
import Html.Attributes exposing (placeholder) | |
import Html.Events exposing (onInput) | |
import Regex as R | |
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 exposing (main) | |
import Browser | |
import GraphQL.Client.Http as GraphQLClient | |
import GraphQL.Request.Builder exposing (..) | |
import Html exposing (Html, div, text) | |
import Task exposing (Task) | |
{-| Responses to `starWarsRequest` are decoded into this type. |
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
find . -name '*.cabal' -exec sh -c 'cabal-fmt $0 > output.tmp; mv output.tmp $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
{ nixpkgs ? (fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-19.09.tar.gz) | |
, system ? builtins.currentSystem | |
}: | |
let | |
haskellnix = import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz); | |
overlay = _: pkgs: | |
let | |
hnPkgs = pkgs.haskell-nix.stackProject { | |
src = ./.; |
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
getPersonStream :: ConduitT () PeopleRequest ServerErrorIO () | |
-> ConduitT PeopleResponse Void ServerErrorIO () | |
-> ServerErrorIO () | |
getPersonStream source sink = runConduit $ source .| reStream .| sink | |
where | |
reStream = do | |
req <- await | |
case req of | |
Nothing -> return () | |
Just r -> do |
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
import React, { useReducer, createContext } from 'react' | |
import { propOr } from 'ramda' | |
import en from '../../assets/literals/EN' | |
import es from '../../assets/literals/ES' | |
const translations = { en, es } | |
const getTranslate = lang => key => propOr(key, key, translations[lang]) | |
const initialState = { lang: 'en', t: getTranslate('en') } |