Skip to content

Instantly share code, notes, and snippets.


eugene yokota eed3si9n

View GitHub Profile
eed3si9n / Main.scala
Last active September 9, 2021 16:30 — forked from xuwei-k/Main.scala
View Main.scala
object Main {
def head[A](list: List[A]): A = list.head
def x1: List[Int] | List[String] = List(3)
// this conversion is ok. the opposite doesn't work.
def x2: List[Int | String] = x1
def x3 = head(x1)
eed3si9n / Main.scala
Last active August 5, 2017 13:33 — forked from xuwei-k/Build.scala
sbt plugin star ranking (using Gigahorse)
View Main.scala
package sbt_plugin_ranking
import gigahorse._, support.okhttp.Gigahorse
import gigahorse.github.Github
import scala.concurrent._, duration._
object Main extends App{
val repo = """https:\/\/\/([a-zA-Z0-9_\-]+)\/([a-zA-Z0-9_\-]+)""".r
val url = ""
val html = io.Source.fromURL(url).mkString
View roper.html
<div style="color:rgb(0,0,0);font-size:medium;font-family:'Helvetica Neue',Arial,sans-serif">
<div style="font-size:13.6px;font-weight:bold;border-bottom-width:2px;border-bottom-style:solid;border-bottom-color:rgb(44,185,219);padding-bottom:3px;width:188px;white-space:nowrap">
<a href="" style="text-decoration:none;color:rgb(44,185,217)" target="_blank">JOIN US. REGISTER TODAY!</a>
<div style="font-size:38px;overflow:hidden">
<div style="width:97px;float:left;white-space:nowrap">
<a href="" style="text-decoration:none;color:rgb(44,185,217);font-weight:200" target="_blank"><span class="il">Scala</span></a>
<div style="font-weight:bold;white-space:nowrap">
View kind.scala
Welcome to Scala version 2.11.0-20130329-215811-f2121a31ef (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_43).
Type in expressions to have them evaluated.
Type :help for more information.
scala> import scalaz._, Scalaz._
import scalaz._
import Scalaz._
scala> :k Monad
Monad's kind is (* -> *) -> *
eed3si9n / Macros.scala
Last active December 13, 2015 23:29 — forked from xuwei-k/Macros.scala
View Macros.scala
import scala.reflect.macros.Context
import scala.util.matching.Regex
import java.util.regex.PatternSyntaxException
object Macros {
implicit class RegexContext(val c: String) {
def regex(): Regex = macro regexImpl
def regexImpl(c: Context)(): c.Expr[Regex] = {
View ast-transformation.scala
object Test {
def main(args: Array[String]): Unit = {
abstract class Transformer {
def transform(tree: Transformable): Transformable = tree match {
case Class(name, body) => Class(transformName(name), body map {transform(_).asInstanceOf[Statement]})
case VariableWrite(id, value) => VariableWrite(transformName(id), transform(value).asInstanceOf[Expression])
case Return(expr) => Return(transform(expr).asInstanceOf[Expression])
case VariableAccess(id) => VariableAccess(transformName(id))
case Value(value) => Value(transformValue(value))
eed3si9n / go.scala
Created February 14, 2012 20:11 — forked from afternoon/go.xsd
XML Schema for Go Feeds API
View go.scala
// Generated by <a href="">scalaxb</a>.
package go
case class Pipelines(link: go.Link,
pipeline: go.Pipeline)
case class Job(jobsequence1: Option[go.JobSequence1] = None,
href: Option[] = None,
eed3si9n / Main.scala
Created February 14, 2012 09:47 — forked from xuwei-k/Main.scala
generate specs2 DataTables using treehugger
View Main.scala
object Main extends App {
import treehugger.forest._
import definitions._
import treehuggerDSL._
val n = 10
object sym {
val nList = (1 to n).toList
val TableHeader = RootClass.newClass("TableHeader")