Skip to content

Instantly share code, notes, and snippets.

Avatar

Anton Parkhomenko chuwy

View GitHub Profile
@sortega
sortega / ForFree.scala
Created Oct 3, 2016
I informally demoed the concept of Free monad to a colleague and he asked for the code. I've added a couple comments to make it standalone.
View ForFree.scala
package experiments
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.{Await, Future}
import scalaz._
import Scalaz._
import scala.concurrent.duration.Duration
import natural.TypeSafeMap
@oyvindholmstad
oyvindholmstad / schema-generator.js
Last active Sep 21, 2018
BigQuery JSON schema generator in Javascript and Scala
View schema-generator.js
/*
A script to generate a Google BigQuery-complient JSON-schema from a JSON object.
Make sure the JSON object is complete before generating, null values will be skipped.
References:
https://cloud.google.com/bigquery/docs/data
https://cloud.google.com/bigquery/docs/personsDataSchema.json
https://gist.github.com/igrigorik/83334277835625916cd6
... and a couple of visits to StackOverflow
@runarorama
runarorama / gist:dba2699f064460228315
Last active Jun 4, 2017
Finalizers with monadic regions
View gist:dba2699f064460228315
object SafeIO {
trait Brace[M[_]] extends Monad[M] {
def brace[A,B,C](acquire: M[A])(release: A => M[B], go: A => M[C]): M[C]
def snag[A](m: M[A], f: Throwable => M[A]): M[A]
def lift[A](t: Task[A]): M[A]
}
object Brace {
def apply[M[_]:Brace]: Brace[M] = implicitly[Brace[M]]
@djspiewak
djspiewak / streams-tutorial.md
Created Mar 22, 2015
Introduction to scalaz-stream
View streams-tutorial.md

Introduction to scalaz-stream

Every application ever written can be viewed as some sort of transformation on data. Data can come from different sources, such as a network or a file or user input or the Large Hadron Collider. It can come from many sources all at once to be merged and aggregated in interesting ways, and it can be produced into many different output sinks, such as a network or files or graphical user interfaces. You might produce your output all at once, as a big data dump at the end of the world (right before your program shuts down), or you might produce it more incrementally. Every application fits into this model.

The scalaz-stream project is an attempt to make it easy to construct, test and scale programs that fit within this model (which is to say, everything). It does this by providing an abstraction around a "stream" of data, which is really just this notion of some number of data being sequentially pulled out of some unspecified data source. On top of this abstraction, sca

@debasishg
debasishg / gist:8172796
Last active Aug 15, 2022
A collection of links for streaming algorithms and data structures
View gist:8172796
  1. General Background and Overview
@phred
phred / pedantically_commented_playbook.yml
Last active May 27, 2022
Very complete Ansible playbook, showing off all the options
View pedantically_commented_playbook.yml
---
####
#### THIS IS OLD AND OUTDATED
#### LIKE, ANSIBLE 1.0 OLD.
####
#### PROBABLY HIT UP https://docs.ansible.com MY DUDES
####
#### IF IT BREAKS I'M JUST SOME GUY WITH
#### A DOG, OK, SORRY
####