- Issue the following commands from the command line in your Yii application directory:
chmod +x shell
mkdir extensions/yiishell
wget -O extensions/yiishell/psysh psysh.org/psysh
chmod +x extensions/yiishell/psysh
- Copy the file
init.php
below toextensions/yiishell/init.php
and update any paths to work with your application configuration - Copy the file
config.php
below toextensions/yiishell/config.php
. Change or add to the config array with the options you'd like to use (available options) - Now you can start PsySH with the command
extensions/yiishell/psysh extensions/yiishell/init.php --config extensions/yiishell/config.php
This file contains 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
exit(Gem::Dependency.new('', "~> #{ARGV[0]}").match?('', ARGV[1]) ? 0 : 1) |
The goal here is to create an array of [0, 1, 2, 3, 4]
. Every "Working ES6" column below accomplishes this. The first
example fails to compile in TypeScript. The second example compiles and works, but throws errors in IE. The third
example compiles, but does not achieve the desired functionality. The last example works as expected
(it was found in the comments of Microsoft/TypeScript#8856).
Working ES6 | TypeScript | Compiled JS | Result |
---|---|---|---|
[...Array(5).keys()] |
error TS2461: Type 'IterableIterator' is not an array type. | n/a | n/a |
Array.from(Array(5).keys()) |
Array.from(Array(5).keys()) |
Array.from(Array(5).keys()) |
[0, 1, 2, 3, 4] , but does not work in IE |
[...Array(5)].map((_, i) => i) |
[...Array(5)].map((_: any, i: number) => i) |
Array(5).slice().map(function (_, i) { return i; }) |
[undefined, undefined, undefined, undefined, undefined] |
This file contains 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
elixirscript ':console.log("test")' --elixir |
This file contains 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 ruby | |
################################################################################ | |
# # | |
# Starts a Scala REPL with the highest version of each jar in # | |
# $HOME/.ivy2/cache on the classpath. # | |
# # | |
# See below for installation instructions # | |
# # | |
################################################################################ |
This file contains 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
,----, | |
,/ .`| | |
,` .' : .--.--. ,----, ,-. | |
; ; // / '. .' .' \ ,--/ /| | |
.'___,/ ,'| : /`. / ,----,' |,--. :/ | | |
| : | ; | |--` | : . ;: : ' / | |
; |.'; ; | : ;_ ; |.' / | ' / | |
`----' | | \ \ `. `----'/ ; ' | : | |
' : ; `----. \ / ; / | | \ | |
| | ' __ \ \ | ; / /-, ' : |. \ |
This file contains 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 $ivy.`com.chuusai::shapeless:2.3.3` | |
// import $ivy.`com.chuusai::shapeless:2.3.4-SNAPSHOT` | |
import $ivy.`org.scalaz::scalaz-core:7.2.17` | |
interp.repositories() ++= Seq(coursier.MavenRepository("https://dl.bintray.com/bondlink/Typify")) | |
import $ivy.`typify::typify:2.4.1` | |
import shapeless.{::, HNil} | |
import shapeless.syntax.singleton._ |
This file contains 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.{::, HList, HNil, Poly2} | |
import shapeless.ops.hlist.Prepend | |
import shapeless.record._ | |
import shapeless.syntax.singleton._ | |
val h = 1 :: "foo" :: true :: HNil | |
object withoutAnnotation extends Poly2 { | |
implicit def id[Acc <: HList, A, Res <: HList]( | |
implicit pp: Prepend.Aux[Acc, A :: HNil, Res]) = |
This file contains 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.language.experimental.macros | |
import scala.reflect.macros.blackbox.Context | |
trait Csv[A] { def apply(a: A): Seq[String] } | |
object Csv { | |
implicit def deriveCsv[A]: Csv[A] = macro CsvMacro.csvImpl[A] | |
implicit val csvStr: Csv[String] = new Csv[String] { def apply(s: String) = Seq(s) } | |
implicit def csvSeq[A](implicit ca: Csv[A]): Csv[Seq[A]] = new Csv[Seq[A]] { | |
def apply(a: Seq[A]) = a.flatMap(ca(_)) |
OlderNewer