- Change Management
- Coaching
- Communication
- Copywriting
- Design
- JavaScript
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 demo | |
| import scala.tools.nsc.io.AbstractFile | |
| import scala.tools.nsc.{Global, Phase} | |
| import scala.tools.nsc.plugins.{Plugin, PluginComponent} | |
| class DemoPlugin(val global: Global) extends Plugin { | |
| import global._ | |
| override def init(options: List[String], error: String => Unit): Boolean = true |
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
| object StaticFile { | |
| // Various necessary imports. Notes: | |
| // | |
| // 1. fs2 is necessary. See https://github.com/functional-streams-for-scala/fs2 | |
| // 2. streamz is necessary. See https://github.com/krasserm/streamz | |
| // 3. Apache Tika is used to infer MIME types from file names, because it's more reliable and | |
| // fully-featured than using java.nio.file.Files.probeContentType(). | |
| // | |
| // If using SBT, you'll want these library dependencies and resolvers: |
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 bash | |
| # | |
| set -euo pipefail | |
| unset SBT_OPTS JVM_OPTS JDK_HOME JAVA_HOME | |
| : ${TRAVIS_SCALA_VERSION:=2.11.8} | |
| : ${SBT_TARGET:=$*} | |
| : ${SBT_TARGET:=test} |
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
| export WORKDIR=$HOME/work | |
| # Creates a working tree to check out a branch locally. | |
| # This is useful when you have multiple branches on origin, | |
| # and want to pull work work with them | |
| function worktree() { | |
| # We assume we're always under $WORKDIR somewhere. | |
| # Go down the tree until we know what project we're in. | |
| while [[ "$(dirname "$PWD")" != $WORKDIR ]] ; do | |
| find "$PWD"/ -maxdepth 1 "$@" |
Free O'Reilly books and convenient script to just download them.
Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post
How to use:
- Take the
download.shfile and put it into a directory where you want the files to be saved. cdinto the directory and make sure that it has executable permissions (chmod +x download.shshould do it)- Run
./download.shand wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.
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
| # Uses Alex Archambault's coursier launcher | |
| # Download as follows: | |
| # $ curl -L -o coursier https://git.io/vgvpD && chmod +x coursier | |
| # ... or refer to instructions here: <https://github.com/alexarchambault/coursier> | |
| # list any dependencies here | |
| COURSIER_CLASSPATH="$(coursier fetch -p com.chuusai:shapeless_2.11:2.3.1)" | |
| # this downloads and launches tut in a seperate step | |
| # the 'classpath' argument is being interpreted by scalac |
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
| -- Our goal is to create a type describing a list of events. This is our | |
| -- type-level DSL. | |
| -- We will then use typeclass resolution to "interpret" this type-level DSL | |
| -- into two things: | |
| -- 1. A comma-separated list of events | |
| -- 2. A method that, when given an event name and a payload, will try to parse | |
| -- that event type with the payload. A form of dynamic dispatching | |
| -- | |
| -- To model a list of types we will use tuples. You can imagine the list of | |
| -- types "Int, String, Char" to look like: |
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
| % sbtx dependencyGraph | |
| ... blah blah ... | |
| [info] *** Welcome to the sbt build definition for Scala! *** | |
| [info] Check README.md for more information. | |
| [error] Not a valid command: dependencyGraph | |
| [error] Not a valid project ID: dependencyGraph | |
| % sbtx -Dplugins=graph dependencyGraph | |
| ... blah blah ... |
Usage :
chmod u+x ./zen.sh
./zen.sh my-dcos-stack