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 cats._ | |
import cats.implicits._ | |
import org.http4s._ | |
import org.http4s.client._ | |
object clientImplicits { | |
implicit class ClientSyntax[F[_], E](val client: Client[F]) extends AnyVal { | |
def expectOption[A]( | |
req: F[Request[F]])(implicit dec: EntityDecoder[F, A], E: ApplicativeError[F, E]): F[Option[A]] = { | |
client.expect[A](req).map[Option[A]](Some(_)).recover { |
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
trait Persisted { | |
def id: UUID | |
} | |
trait BasicDoobieTable[M <: Persisted] { | |
def table: String | |
def columns: Seq[String] | |
implicit def composite: Composite[M] |
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 Form exposing (..) | |
import Form.Input as Input | |
import Form.Validate exposing (..) | |
import Html exposing (..) | |
type Color | |
= Red |
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
package dao | |
import scalaz.concurrent.Task | |
import scalaz.stream.Process | |
import doobie.imports._ | |
import scalaz._ | |
import Scalaz._ | |
import models.Persisted |
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
const sendWindowMouseDrags = port => { | |
let mouseDown = false; | |
let mousePosition = { x: null, y: null }; | |
const getPoint = e => ({ x: e.pageX, y: e.pageY }); | |
document.addEventListener('mousedown', e => { | |
mousePosition = getPoint(e); | |
mouseDown = true; | |
port.send([mousePosition, null]); |
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
onMouseWheel : Address a -> (Float -> a) -> Attribute | |
onMouseWheel address toAction = | |
let | |
handler v = Signal.message address (toAction v) | |
in | |
onWithOptions "wheel" defensiveOptions decodeWheelEvent handler | |
defensiveOptions : Options | |
defensiveOptions = | |
{ stopPropagation = True |
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
const sendMouseDrags = port => { | |
let mouseDown = false; | |
let mousePosition = { x: null, y: null }; | |
const getPoint = e => ({ x: e.pageX, y: e.pageY }); | |
document.addEventListener('mousedown', e => { | |
mousePosition = getPoint(e); | |
mouseDown = true; |
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
-- which style do you prefer? | |
-- commas/brackets first | |
rowView : Chart -> Html | |
rowView chart = | |
tr [] | |
[ th [] | |
[ text chart.label ] | |
, td | |
[ class "toggle" |
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
# yaourt displaylink | |
# sudo systemctl enable displaylink.service | |
# sudo systemctl start displaylink.service | |
# xrandr --listproviders | |
# xrandr --setprovideroutputsource 1 0 | |
# sudo modprobe udl | |
# sudo vim /etc/modules-load.d/udl.conf | |
udl |
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 Foo where | |
type Bar = { baz : Maybe Float } |
NewerOlder