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
// HList | |
sealed trait HList | |
object HList { | |
type ::[H, T <: HList] = HCons[H, T] | |
type HNil = HNil.type | |
implicit final class HNilOps(private val self: HNil) extends AnyVal { | |
def ::[A](a: A): A :: HNil = HCons(a, self) |
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
/** A fancy, functional graph encoding taken from here: | |
* https://github.com/snowleopard/alga-paper | |
*/ | |
sealed trait Graph[+A] { self => | |
import Graph._ | |
def toStandardGraph[A1 >: A]: StandardGraph[A1] = | |
fold[StandardGraph[A1]]( | |
empty = StandardGraph(Set.empty, Set.empty), | |
vertex = value => StandardGraph(Set(value), Set.empty), |
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
object Main { | |
val css: Css.type = Css | |
println(s"PRODUCTION MODE: ${scala.scalajs.LinkingInfo.productionMode}") | |
def main(args: Array[String]): Unit = | |
waitForLoad { | |
val appContainer = dom.document.querySelector("#app") | |
appContainer.innerHTML = "" | |
unmount() |
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
package hlist | |
import hlist.HList.HNil | |
import meetup.TupleExtractor | |
sealed trait HList | |
case class ::[H, T <: HList](head: H, tail: T) extends HList | |
case object HNil extends HList { self => | |
def ::[H](that: H): H :: HNil = new ::(that, self) |
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
import Aggregator.AggregationSyntax | |
import io.getquill.context.ZioJdbc.{QConnection, QDataSource} | |
import io.getquill.{PostgresZioJdbcContext, Query, SnakeCase} | |
import zio._ | |
import zio.blocking.Blocking | |
import zio.console.putStrLn | |
object QuillContext extends PostgresZioJdbcContext(SnakeCase) | |
import QuillContext._ |
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
<template name="fr" value="for { $VARIABLE$ <- $VALUE$ } yield $FINISH$" description="for comprehension" toReformat="false" toShortenFQNames="true"> | |
<variable name="VALUE" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="VARIABLE" expression="" defaultValue=""x"" alwaysStopAt="true" /> | |
<variable name="FINISH" expression="" defaultValue="VARIABLE" alwaysStopAt="true" /> | |
<context> | |
<option name="SCALA" value="true" /> | |
</context> | |
</template> | |
<template name="FR" value="for { $VARIABLE$ <- $SELECTION$ } yield $FINISH$" description="for comprehension" toReformat="false" toShortenFQNames="true"> | |
<variable name="VARIABLE" expression="" defaultValue=""x"" alwaysStopAt="true" /> |
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
package animator | |
import com.raquo.airstream.eventstream.EventStream | |
import com.raquo.airstream.signal.{Signal, Var} | |
import magnolia.{CaseClass, Magnolia} | |
import org.scalajs.dom | |
import scala.language.experimental.macros | |
object Time { |
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
from talon import Context, actions | |
import webbrowser | |
ctx = Context("vim") | |
ctx.lists["self.commands"] = { | |
"change": "c", | |
"delete": "d", | |
"yank": "y", | |
"copy": "y", |
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 #-} | |
module Lib where | |
import Text.HTML.Scalpel | |
import Data.Maybe (fromMaybe) | |
import Data.Char | |
import Control.Applicative | |
import Text.Read (readMaybe) |
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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
session: Ember.inject.service('session'), | |
sessionAccount: Ember.inject.service(), | |
actions: { | |
authenticate() { | |
let {email, password} = this.getProperties('email', 'password'); | |
this.get('session').authenticate('authenticator:devise', email, password) |