Skip to content

Instantly share code, notes, and snippets.

Brady Ouren tippenein

Block or report user

Report or block tippenein

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View CodeGen.purs
-- File auto generated by purescript-bridge! --
module App.Crud where
import Data.Lens (Lens', Prism', lens, prism')
import Data.Lens.Iso.Newtype (_Newtype)
import Data.Lens.Record (prop)
import Data.Maybe (Maybe, Maybe(..))
import Data.Newtype (class Newtype)
import Data.Symbol (SProxy(..))
View circle.yml
machine:
services:
- postgresql
database:
override:
- createuser -s -d test
- createdb rsvptest
dependencies:
View extending.purs
-- like this?
import Language.PureScript.Bridge.PSTypes (psInt)
int64Bridge :: BridgePart
int64Bridge = typeName ^== "Int64" >> return psInt
mainBridge = defaultBridge <|> int64Bridge
@tippenein
tippenein / t.hs
Created Sep 12, 2017
using withServantServer tets generation
View t.hs
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE KindSignatures #-}
module Main
( main
) where
@tippenein
tippenein / flash.purs
Created Aug 31, 2017
a simple flashMessage function for web app notifications
View flash.purs
import Control.Monad.Eff.JQuery as Q
import Prelude hiding (div)
import Control.Monad.Eff
import Control.Monad.Eff.Timer (TIMER)
data Message
= Success
| Failure
| Info
View naive_amortization.rb
# naive amortization implementation using enumerators.
# used for a possible answer to compare against candidate solutions
# intended to determine how a candidate breaks up a problem
# similar haskell implementation - https://gist.github.com/tippenein/8dceb2d50272ec24ce13fe83f3a57bfa
module Amortizable
include Enumerable
@tippenein
tippenein / file_hash.hs
Created Oct 7, 2016
sha256 hash file(s) from command line
View file_hash.hs
#!/usr/bin/env runhaskell
import Crypto.Hash
import Data.ByteString
import Prelude hiding (readFile)
import System.Environment (getArgs)
keyFor :: FilePath -> IO ()
keyFor filepath = do
bytes <- readFile filepath
View nub_spaces.hs
import Data.List (intercalate)
import Data.List.Split (splitOn)
nub_spaces :: String -> String
nub_spaces = splitOn " " |> filter (/= "") |> join " "
(|>) = flip (.)
join = intercalate
main = do
View naive_timer.hs
import Text.Parsec
type Parser = Parsec String ()
data T = T { hours :: Int, minutes :: Int, seconds :: Int }
instance Show T where
show (T h m s) = show h ++ " hours " ++ show m ++ " minutes " ++ show s ++ " seconds"
parse' :: Parser a -> String -> Either ParseError a
@tippenein
tippenein / blog.elm
Created Aug 5, 2016
pieces of an elm example
View blog.elm
type Action
= FetchDocuments
| ErrorOccurred String
| DocumentsFetched (List Document)
model : Model
model =
{ documents = Right []
, queryString = ""
}
You can’t perform that action at this time.