Skip to content

Instantly share code, notes, and snippets.

@ragb
ragb / build.sbt
Created March 22, 2019 17:04
scala meetup build
import Dependencies._
import Slides._
lazy val root = (project in file("."))
.settings(
inThisBuild(List(
organization := "co.enear",
scalaVersion := "2.12.8",
version := "0.1.0-SNAPSHOT",
@ragb
ragb / build.sbt
Created March 22, 2019 11:48
my gist build
import Dependencies._
import Slides._
lazy val root = (project in file(".")).
settings(
inThisBuild(List(
organization := "co.enear",
scalaVersion := "2.12.7",
version := "0.1.0-SNAPSHOT",
@ragb
ragb / file.txt
Created March 22, 2019 11:26
meetup gist
this is the content
@ragb
ragb / file.txt
Created March 22, 2019 11:26
meetup gist
this is the content

Keybase proof

I hereby claim:

  • I am ragb on github.
  • I am ragb (https://keybase.io/ragb) on keybase.
  • I have a public key ASBOe-uy2gdK_EnJUGodkpNoAkPes1I1uiSKvoXjipWoIwo

To claim this, I am signing this object:

@ragb
ragb / Nats.scala
Created February 19, 2017 19:03
Type-level natural numbers in Scala, with operations. Inspiration is Shapeless, but very simplified.
// This is a natural number
trait Nat
{
type N <: Nat
}
// This is Zero
class Zero extends Nat {
type N = Zero
@ragb
ragb / MaybeUtils.scala
Last active September 25, 2015 16:04
Slick 3 extension methods based on option values.
import slick.lifted._
/**
* Utilities to process and modify queries based on option values.
* This are mostly syntax helpers.
*/
object MaybeUtils {
implicit class MaybeExtensionMethods[E, U, C[_]](query: Query[E, U, C]) {
def maybeCompose[T](op: Option[T])(f: T => Query[E, U, C] => Query[E, U, C]) = {
op.map(o => f(o)(query)) getOrElse (query)
<html>
<head>
<title>Scope example</title>
</head>
<body>
<!-- Buttons container -->
<div id="buttons"></div>
<script type="text/javascript">
// Run this on window load event
// Three buttons are added to the buttons containr
(function() {
console.log("hello from function");
})();
@ragb
ragb / index.html
Last active August 29, 2015 13:57
<html>
<head>
<title>Scope example</title>
</head>
<body>
<!-- Buttons container -->
<div id="buttons"></div>
<script type="text/javascript">
// Run this on window load event
// Three buttons are added to the buttons containr