Skip to content

Instantly share code, notes, and snippets.

View travisbrown's full-sized avatar
😎
In hiding

Travis Brown travisbrown

😎
In hiding
View GitHub Profile
@travisbrown
travisbrown / blocksigners.sh
Created March 28, 2021 21:33 — forked from kyhwana/blocksigners.sh
Block RMS support letter signers
#replace "<PAT TOKEN>" with your github PAT token, tested with "Update ALL user data" PAT token.
curl -q https://rms-support-letter.github.io/ | grep "<li>" | grep "github.com" | awk -F "https://github.com/" '{ print $2 }' | awk -F "\"\>" '{ print $1 }' | sed 's/\///g' | sed '/^$/d' | xargs -I USER curl -i -X PUT -H "Authorization: token <PAT token>" -H "Accept: application/vnd.github.v3+json" https://api.github.com/user/blocks/USER
@travisbrown
travisbrown / circe-loop-json-object-example.md
Created March 23, 2016 13:22 — forked from pvoznenko/circe-loop-json-object-example.md
How to loop through json object and change values with circe, scala

How to go through json object and change values with Circe in Scala

Small gist with some demo trait that shows an example on how to loop through json object and change values with circe in Scala.

Code exmaple you can find below at circe-loop-json-object-example.scala.

The input JSON for test is kinda in in DynamoDB dump format:

@travisbrown
travisbrown / MonadADT.scala
Last active April 28, 2017 02:34 — forked from kevinmeredith/MonadADT.scala
Sequencing through Monad with ADT
// Given the following ADT:
sealed trait Status
case object One extends Status
case object Two extends Status
case object Three extends Status
// They represent states. The natural progression, for this
// example, is : One -> Two -> Three

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

@travisbrown
travisbrown / README.md
Last active August 29, 2015 14:13 — forked from decretist/README.md

6714256

edF.txt 2192,2194:

    <4 7> -[C. VII.]+ <T R> Ait enim Gregorius I., -[lib. VII. reg. epist. 112.]+
    Siagrio Episcopo Augustodunensi:
    <T T> ...

edF.txt 10695,10697:

sealed trait Key {
type Inner
def inner: Inner
}
trait IntKey extends Key {
type Inner = Int
}
trait StringKey extends Key {
type Inner = String
// in bijection branch jco/macro_case_class_plus
// ./sbt "bijection-macros/console"
// paste the following
// Use :paste until the break below.
:paste
import com.twitter.bijection._
import com.twitter.bijection.macros.common.TypesNotEqual
trait Semigroup[T] {
package shapeless.stuff
import shapeless._
import nat._
import ops.nat._
import ops.hlist._
/**
* The goal is to determine whether a list of numbers is the appropriate length
* (nine) and has a valid checksum, which is calculated by taking the sum of
scalaVersion := "2.11.2"
libraryDependencies += "com.chuusai" %% "shapeless" % "2.0.0"
name := "Observe Sample"
trait Obs[+A] { def value: A }
object Obs {
import shapeless._, poly._, ops.hlist.Mapper, ops.function.FnToProduct
object values extends (Obs ~> Id) {
def apply[T](t: Obs[T]) = t.value
}
def calculate[T, V <: HList, L <: HList, F, Z](obss: T)(f: F)(implicit