This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import shapeless._ | |
import shapeless.record._ | |
import shapeless.ops.record._ | |
import syntax.singleton._ | |
object Main extends App { | |
// === Your normal code base ========================================================================================= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cats._ | |
import cats.data.State | |
import cats.effect.{ExitCode, IO, IOApp} | |
import cats.implicits._ | |
import scala.io.Source | |
// Tweet: https://twitter.com/francoaramburo/status/1081303164660473857 | |
object Main extends IOApp { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.concurrent.{ExecutionContext, Future} | |
import Monad.syntax._ | |
import scalaz.reactive.tmp.lambda_tickets.{HttpImplementation, Id, MockedImplementation} | |
object tickets { | |
import scala.concurrent.ExecutionContext.Implicits.global | |
// Q: How many implementations does this have? A: mathematically infinite | |
// Q: How many implementations differ from the one you intended? A: mathematically infinite |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* See: http://underscore.io/blog/posts/2015/06/04/more-on-sealed.html */ | |
sealed trait FrostSpell extends Product with Serializable | |
case object Blizzard extends FrostSpell | |
case object Icebolt extends FrostSpell | |
object FrostSpell { | |
implicit val ordering: Ordering[FrostSpell] = new Ordering[FrostSpell] { | |
override def compare(x: FrostSpell, y: FrostSpell): Int = (x,y) match { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Instantiate this class and use the method "execute", just give the image url and the ImageView where you want to set it. | |
* Notice that you may only use the method once, you need to have one object per image request. | |
* You don't have to worry about threads or blocking your app, this is handled with the AsyncTask class. | |
*/ | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.net.HttpURLConnection; | |
import java.net.MalformedURLException; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
// This file has to have execution permission. | |
// You can do it with 'sudo chmod 777 thisfile', will give write, read and execute permissions to everyone. | |
// To execute it from terminal be sure that your $PATH is updated, adding the path of this file to it. | |
var delegate = require('../lib/delegate') // Replace delegate with the module which will handle the commands functionality. | |
var args = new ArgumentsCollection(); | |
// # Declaration of your app arguments |