This file contains 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 OverloadedStrings #-} | |
{-# LANGUAGE DeriveGeneric #-} | |
import Control.Monad.IO.Class (liftIO) | |
import Data.Aeson (ToJSON, Value) | |
import Data.Time.Clock (UTCTime, getCurrentTime) | |
import Data.Text.Lazy (Text) | |
-- import Data.Monoid (mconcat) |
This file contains 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 Reuse.TabsExercise exposing (..) | |
import Html exposing (Html, div, text, button, span, header, a) | |
import Html.Attributes exposing (style) | |
import Html.Events exposing (onClick) | |
import Html.App as Html | |
import Reuse.Functions as Order exposing (Msg3(..), update3, Model) | |
import Reuse.Examples.Button as Button | |
This file contains 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 Outside.AdvancedJson exposing (..) | |
import Json.Decode as Json exposing (decodeString, succeed, string, (:=), Decoder, maybe, oneOf, list, float, int) | |
import Json.Decode.Extra exposing ((|:)) | |
import Json.Encode as Encode | |
import String | |
import Html exposing (div, h1, h2, text, button, ul, li, Html) | |
import Html.App exposing (program) | |
import Html.Events exposing (onClick) | |
import Http |
This file contains 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
fade : Bool -> Float -> Styles | |
fade isShown splashHeight = | |
[ transition "opacity 250ms, margin-top 250ms 250ms" | |
, opacity (float 0) | |
, marginTop (px -splashHeight) | |
] | |
++ if isShown then | |
fadeShown | |
else | |
[] |
This file contains 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
// | |
// Post.swift | |
// | |
// | |
// Created by Greg Rosich on 7/14/16. | |
// | |
// | |
import Foundation |
This file contains 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
(defproject sampling "0.1.0-SNAPSHOT" | |
:description "FIXME: write description" | |
:url "http://example.com/FIXME" | |
:license {:name "Eclipse Public License" | |
:url "http://www.eclipse.org/legal/epl-v10.html"} | |
:dependencies [[org.clojure/clojure "1.7.0"] | |
[org.clojure/clojurescript "1.7.170"] | |
[reagent "0.5.1" :exclusions [cljsjs/react]] | |
[re-frame "0.6.0"] | |
[prismatic/schema "1.0.4"]] |
This file contains 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
2016-03-17 15:49:07.730 CrossProcess[22792:285165] RED | |
2016-03-17 15:49:07.730 CrossProcess[22792:285165] _numPoints = 17 | |
2016-03-17 15:49:07.730 CrossProcess[22792:285165] point = {0, 0} | |
2016-03-17 15:49:07.731 CrossProcess[22792:285165] point = {-1, -1} | |
2016-03-17 15:49:07.731 CrossProcess[22792:285165] point = {-1, -1} | |
2016-03-17 15:49:07.731 CrossProcess[22792:285165] point = {-1, -1} | |
2016-03-17 15:49:07.731 CrossProcess[22792:285165] point = {-1, -1} | |
2016-03-17 15:49:07.731 CrossProcess[22792:285165] point = {-1, -1} | |
2016-03-17 15:49:07.732 CrossProcess[22792:285165] point = {-1, -1} | |
2016-03-17 15:49:07.732 CrossProcess[22792:285165] point = {-1, -1} |
This file contains 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
-- combinator that returns a mismatch if the method doesn't match | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE TypeSynonymInstances #-} | |
module Servant.Method where |
This file contains 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
type ModelAPI = | |
"models" :> | |
( ProjectKey :> Get '[JSON] [Model] | |
:<|> ProjectKey :> MultipartUpload :> Post '[JSON] Model | |
:<|> ProjectKey :> Capture "modelId" ID :> Get '[JSON] Model | |
:<|> ProjectKey :> Capture "modelId" ID :> "predictions" :> ReqBody '[JSON] PredictionInput :> Post '[JSON] Prediction | |
:<|> ProjectKey :> Capture "modelId" ID :> "predictions" :> Get '[JSON] [Prediction] | |
:<|> ProjectKey :> Capture "modelId" ID :> "predictions" :> Capture "predictionId" ID :> Get '[JSON] Prediction | |
) |
This file contains 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
-- First, I made it application specific | |
attemptConnect :: Int -> TWInfo -> Manager -> APIRequest apiName responseType -> ResourceT IO (ResumableSource (ResourceT IO) StreamingAPI) | |
attemptConnect delay twInfo mgr = do | |
ms <- streamShowStatus twInfo mgr (statusesFilter accountName [accountID]) | |
case ms of | |
Just s -> return s | |
Nothing -> do | |
liftIO $ putStrLn ("FAILED, delaying for " <> show delay <> "s") | |
liftIO $ threadDelay (delay * 1000 * 1000) | |
attemptConnect (delay*2) twInfo mgr |