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
package scalafxml.demo.rowcount | |
import scalafx.Includes._ | |
import scalafxml.core.macros.sfxml | |
import scalafx.scene.control.{TableColumn, Label, TableView} | |
import scalafx.event.ActionEvent | |
import scalafx.application.JFXApp | |
import scalafxml.core.{DependenciesByType, FXMLView} | |
import scalafx.scene.Scene | |
import scalafx.beans.property.StringProperty |
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
package scalafxml.demo | |
import scalafx.application.JFXApp | |
import scalafx.Includes._ | |
import scalafx.scene.control.TableView | |
import scalafx.scene.control.TableColumn | |
import scalafxml.core.{FXMLView, DependenciesByType} | |
import scalafxml.core.macros.sfxml | |
import scalafx.scene.Scene | |
import scalafx.beans.property.StringProperty |
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
{-# LANGUAGE OverloadedStrings #-} | |
import Shelly | |
import Data.Text as T | |
default (T.Text) | |
main = shelly $ do | |
git "pull" [] | |
last_commit <- git "log" ["--oneline", "-n 1"] | |
echo $ append "Last commit in this repo was: " last_commit |
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
package io.github.vigoo.rx.schedulers | |
import java.util.{TimerTask, Timer} | |
import java.util.concurrent.TimeUnit | |
import rx.Scheduler.Worker | |
import rx.Subscription | |
import rx.functions.Action0 | |
import rx.lang.scala.Scheduler | |
import rx.subscriptions.{Subscriptions, BooleanSubscription, CompositeSubscription} |
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
class Process[Out, Err, OutResult, ErrResult, | |
IRS <: RedirectionState, ORS <: RedirectionState, ERS <: RedirectionState]( | |
val command: String, | |
val arguments: List[String], | |
val workingDirectory: Option[Path], | |
val inputSource: ProcessInputSource, | |
val outputTarget: ProcessOutputTarget[Out, OutResult], | |
val errorTarget: ProcessErrorTarget[Err, ErrResult], | |
val environmentVariables: Map[String, String]) | |
extends ProcessNode[Out, Err, IRS, ORS, ERS] { |
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
/** Phantom type representing the redirection state of a process */ | |
sealed trait RedirectionState | |
/** Indicates that the given channel is not redirected yet */ | |
trait NotRedirected extends RedirectionState | |
/** Indicates that the given channel has already been redirected */ | |
trait Redirected extends RedirectionState |
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
val p1: Process[NotRedirected, NotRedirected, NotRedirected] = ??? | |
val p2: Process[NotRedirected, Redirected, NotRedirected] = p1 > (home / "tmp" / "out.txt") | |
val p3 = p2 > (home / "tmp" / "another.txt") // THIS MUST NOT COMPILE |
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
implicit class ProcessNodeOutputRedirect[ | |
IRS <: RedirectionState, | |
ERS <: RedirectionState, | |
PN <: Process[IRS, NotRedirected, ERS]](process: PN) { | |
def >[To](to: To)(implicit target: CanBeProcessOutputTarget[To]): Process[IRS, Redirected, ERS] = ??? | |
} |
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
sealed trait ProcessNode[Out, Err, IRS <: RedirectionState, ORS <: RedirectionState, ERS <: RedirectionState] |
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
class PipedProcess[Out, Err, PN1Out, | |
PN1 <: ProcessNode[_, _, _, _, _], | |
PN2 <: ProcessNode[_, _, _, _, _], | |
IRS <: RedirectionState, ORS <: RedirectionState, ERS <: RedirectionState] | |
(val from: PN1, val createTo: PipeConstruction[PN1Out] => PN2) | |
extends ProcessNode[Out, Err, IRS, ORS, ERS] { | |
// ... | |
} |
OlderNewer