Skip to content

Instantly share code, notes, and snippets.

View EECOLOR's full-sized avatar

EECOLOR EECOLOR

  • Kaliber
  • Utrecht, Netherlands
View GitHub Profile
#!/bin/bash -e
#DEPLOY_SERVERS=(vm273 vm274)
#APP_NAME=via-autobeheer-app-test
#DIST=dist/
#STATUS_CHECK_BASE=https://via-autobeheer-app-tst.firebaseio.com
#STATUS_CHECK_LOCATIONS=(/userData/status /token/status)
#SERVICES=(authentication-service userdata-service)
# .oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo. #
@EECOLOR
EECOLOR / react without webpack.js
Last active October 19, 2016 13:58
react without webpack
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Firebase component lifecycle</title>
</head>
<body>
<div id="container" />
<script src="../react/react.js"></script>
<script src="../react/react-dom.js"></script>
@EECOLOR
EECOLOR / .bashrc
Created January 31, 2016 10:26
Git situational awareness
source ~/.git_sit_awareness.sh
const ACTION = 'my-app/widgets/ACTION';
export default function reducer(state = {}, action = {}) {
switch (action.type) {
case ACTION:
return action.reduce(state)
default:
return state;
}
}
@EECOLOR
EECOLOR / commands.json
Created November 10, 2015 07:40
Elasticsearch nested sort problem
PUT /testindex
{
"settings": {
"number_of_replicas": 0,
"number_of_shards": 1
},
"mappings": {
"testtype": {
"dynamic": "strict",
"properties": {
_ = magic
Option[A] = Some[A] | None
/*
O: Objects
A: Arrows
*/
O_00 = { _, X }
O_00 = { _ -> X }
@EECOLOR
EECOLOR / Party.scala
Created March 12, 2015 19:52
If characters were chocolate and parsers were girls, what would happen? (this code has not been tested, that would have been a mess)
object Party {
type Chocolate = Char
type Sticker = Any
def complain(c: Chocolate) = abort(s"You should have asked me if I wanted `$c`")
sealed trait Girl {
def willYouEat(c: Chocolate): VagueAnswer
def eat(c: Chocolate): (Rating, Girl)
@EECOLOR
EECOLOR / como.scala
Last active August 29, 2015 14:15 — forked from paulp/como.scala
package p {
object Test {
import construction.Monadic
import execution.Bimonad
def main(args: Array[String]): Unit = {
val expression = Monadic[List](10) flatMap (1 to _ toList) coflatMap (_.sum)
@EECOLOR
EECOLOR / ProgramTypeHelpers.scala
Created October 5, 2014 11:31
Clean construction of coproducts
trait Co[F[_], G[_]] {
case class Product[A](value: Either[F[A], G[A]])
}
trait ProgramType[F[_]]
object ProgramType {
def apply[T](implicit to: ToParameterized[T]): ProgramType[to.Out] = ???
}
trait ToParameterized[T] {
@EECOLOR
EECOLOR / Test.scala
Last active August 18, 2017 16:20
Branching with free monads
package test
import scala.language.implicitConversions
import scala.language.higherKinds
import scalaz.Free.FreeC
import scalaz.Free
import scalaz.Monad
import scalaz.Coyoneda