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
| #!/bin/sh -e | |
| if [ ! $SBT_VERSION ]; then SBT_VERSION=0.7.4; fi | |
| if [ ! $SBT_DIR ]; then SBT_DIR=$HOME/.sbt; fi | |
| if [ ! $SBT_FILENAME ]; then SBT_FILENAME=sbt-launch-$SBT_VERSION.jar; fi | |
| if [ ! $SBT_LOCATION ]; then SBT_LOCATION=$SBT_DIR/$SBT_FILENAME; fi | |
| SBT_URL="http://simple-build-tool.googlecode.com/files/$SBT_FILENAME" | |
| if [ ! -f $SBT_LOCATION ]; |
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
| // A simple trait: | |
| trait CascadingActions { | |
| implicit def tToActioneerT[T](t: T) = Actioneer(t) | |
| case class Actioneer[T](tee: T) { | |
| def withAction(action: (T => Unit)): T = | |
| withActions(action) | |
| def withActions(actions: (T => Unit)*): T = { |
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
| // dependency: org.apache.httpcomponents %% httpclient % 4.0.1 | |
| class SSLTest { | |
| import javax.net.ssl.SSLContext | |
| import org.apache.http.conn.ssl.SSLSocketFactory | |
| val ctx = SSLContext.getInstance("TLS") | |
| ctx.init(null, null, null) | |
| val sf = new SSLSocketFactory(ctx) |
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
| mkdir bestappever && cd bestappever | |
| g8 gseitz/android-sbt-project | |
| sbt update | |
| sbt 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
| require 'formula' | |
| class Giter8 <Formula | |
| JAR = 'sbt-launch-0.7.4.jar' | |
| url "http://simple-build-tool.googlecode.com/files/#{JAR}" | |
| homepage 'http://github.com/n8han/giter8' | |
| md5 '8903fb141037056a497925f3efdb9edf' | |
| version '0.1.1' | |
| def install |
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
| module TicTacToe | |
| ( Player | |
| , Position | |
| , Board | |
| , InProgress | |
| , Finished | |
| , GameBoard | |
| , Playable | |
| , Completed | |
| , move |
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
| scala> trait YouCantMatchMe | |
| defined trait YouCantMatchMe | |
| scala> object YesICan extends Traitor[YouCantMatchMe] | |
| defined module YesICan | |
| scala> def uncatchable_?(any: Any) = any match { | |
| | case YesICan(uncatchable) => Some(uncatchable) | |
| | case _ => None | |
| | } |
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
| <scheme name="oxbow" version="142" parent_scheme="Default"> | |
| <option name="FONT_SCALE" value="1.0" /> | |
| <metaInfo> | |
| <property name="created">2023-11-22T09:52:13</property> | |
| <property name="ide">idea</property> | |
| <property name="ideVersion">2023.2.5.0.0</property> | |
| <property name="modified">2023-11-22T09:52:19</property> | |
| <property name="originalScheme">oxbow</property> | |
| </metaInfo> | |
| <option name="LINE_SPACING" value="1.2" /> |
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 sample | |
| import java.util.{TimerTask, Timer} | |
| /** | |
| * Shows Java way of creating an anonymous inner class to supply the code for a TimerTask. | |
| */ | |
| object TimerDemo extends Application { | |
| new Timer().schedule(new TimerTask { | |
| def run() { |
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 rhs = Apply(lensApply, lensGet :: lensSet :: Nil) | |
| yields the correct | |
| rhs: scalaz.Lens.apply[test.this.Foo, scala.this.Int](((t: test.this.Foo) => 3), ((t: test.this.Foo, m: scala.this.Int) => t.copy(m))) | |
| val appliedLensType = TypeApply(REF(lensClass), REF(ccClazz) :: TypeTree(ccMember.symbol.tpe) :: Nil) | |
| yields | |
| appliedLensType: scalaz.this.Lens[test.this.Foo, scala.this.Int] |
OlderNewer