Skip to content

Instantly share code, notes, and snippets.

View seanhess's full-sized avatar

Sean Hess seanhess

View GitHub Profile
@seanhess
seanhess / cors.html
Created May 31, 2017 18:12
Cors example
<html>
<script>
var xhr = new XMLHttpRequest();
xhr.open("POST", 'http://localhost:8080/applications', true);
//Send the proper header information along with the request
xhr.setRequestHeader("Content-type", "application/json");
@seanhess
seanhess / Example.hs
Created January 23, 2017 18:35
XML Parsing
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
module Simple.FactorTrust.Proprietary where
import Control.Monad.Except (Except)
import Control.Monad.IO.Class (MonadIO)
import Control.Monad.Catch (MonadCatch)
import Data.Aeson (ToJSON)
import GHC.Generics (Generic)
import Simple.FactorTrust.SendInquiry (sendAPI)
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TupleSections #-}
module HRForms.Data.Answer where
import Prelude hiding (id)
@seanhess
seanhess / Microservice.hs
Created October 31, 2016 22:36
Scotty Microservice
{-# 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)
@seanhess
seanhess / Tabs.elm
Last active September 9, 2016 06:37
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
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
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
[]
@seanhess
seanhess / Post.swift
Created August 10, 2016 19:49
Simple data objects.
//
// Post.swift
//
//
// Created by Greg Rosich on 7/14/16.
//
//
import Foundation
@seanhess
seanhess / project.clj
Created April 18, 2016 15:13
Clojure Project
(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"]]
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}