- About the (simple) exercise
- Higher Order Functions
- Throwing exceptions: here be dragons!!
- Sentinel values: better but not great
- The
Option
: error as an ADT - Functional combinators: add some sugar
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
#!/bin/bash | |
function printit { | |
echo "This is from an embedded function: $1" | |
} | |
function printthat { | |
echo "This is the first line." | |
$1 $2 | |
echo "This is the third line." |
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
#!/bin/bash | |
#Tweak this if need be for you system! | |
TARGET_VOLUME="/Volumes/Macintosh HD" | |
DMG_NAME="jdk-8u101-macosx-x64.dmg" | |
MOUNT_VOLUME="/Volumes/JDK 8 Update 101" | |
SHA_256="680de8ddead3867fc34e7ff380f437c7ddb8dc75eb606186a3e8ae7e3b8c7fbc" | |
echo "Getting the DMG..." |
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
class ForST private constructor() { | |
companion object | |
} | |
typealias STOf<S, A> = arrow.Kind2<ForST, S, A> | |
typealias STPartialOf<S> = arrow.Kind<ForST, S> | |
@Suppress("UNCHECKED_CAST", "NOTHING_TO_INLINE") | |
inline fun <S, A> STOf<S, A>.fix(): ST<S, A> = this as ST<S, A> |
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
================================================================================ | |
Available Java Versions | |
================================================================================ | |
Vendor | Current | Version | Status | Identifier | |
-------------------------------------------------------------------------------- | |
AdoptOpenJDK | | 12.0.1.j9 | available | 12.0.1.j9-adpt | |
| >>> | 12.0.1.hs | available | 12.0.1.hs-adpt | |
| | 11.0.3.j9 | installed | 11.0.3.j9-adpt | |
| | 11.0.3.hs | available | 11.0.3.hs-adpt | |
| | 8.0.212 | available | 8.0.212-adpt |
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
#make sure you have the mvim script on your path already ;-) | |
alias mvim="mvim --servername VIM --remote-tab $1 &> /dev/null" |
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
object Main extends App { | |
RatpackServer.start { spec => | |
spec.serverConfig(c => c.env()) | |
.registry(Guice.registry(g => g.bind(classOf[VersionHandler]))) | |
.handlers(chain => chain.get("version", classOf[VersionHandler])) | |
} | |
} | |
case class VersionConfig(@BeanProperty appName: String, @BeanProperty appVersion: String) |
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
buildscript { | |
repositories { | |
maven { url "https://plugins.gradle.org/m2/" } | |
} | |
dependencies { | |
classpath "com.gradle.publish:plugin-publish-plugin:0.9.6" | |
classpath "com.netflix.nebula:nebula-kotlin-plugin:1.0.3" | |
} | |
} |
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
#bin/bash | |
SESSION="gradle" | |
tmux -2 new-session -d -s $SESSION | |
tmux new-window -t $SESSION:1 -n 'benchmark' | |
tmux split-window -v | |
tmux select-pane -t 0 | |
tmux send-keys "clear" C-m | |
tmux send-keys "docker run -it marc0der/gradle:1 zsh" C-m | |
tmux send-keys "sdk use gradle 2.12" C-m |
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 groovy | |
@Grab("org.codehaus.geb:geb-core:0.7.2") | |
@Grab("org.seleniumhq.selenium:selenium-chrome-driver:2.48.2") | |
import geb.* | |
import java.security.MessageDigest | |
import static java.net.URLDecoder.decode |
NewerOlder