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 org.siliconvalleypatterns | |
/** | |
* @author [email protected] | |
*/ | |
class CompiledRegexMatcher(val regex: String) { | |
def compile(): List[Token] = { | |
def compile(regex: String): List[Token] = { | |
if (regex.isEmpty) { | |
Nil |
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
import com.google.inject.AbstractModule; | |
import com.google.inject.Guice; | |
import com.google.inject.Inject; | |
import com.google.inject.Injector; | |
import com.google.inject.Key; | |
import com.google.inject.TypeLiteral; | |
import com.google.inject.assistedinject.Assisted; | |
import com.google.inject.assistedinject.FactoryModuleBuilder; | |
import org.junit.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
import com.google.inject.AbstractModule; | |
import com.google.inject.Guice; | |
import com.google.inject.Inject; | |
import com.google.inject.Injector; | |
import com.google.inject.assistedinject.Assisted; | |
import com.google.inject.assistedinject.FactoryModuleBuilder; | |
import org.junit.Test; | |
import static org.hamcrest.Matchers.is; | |
import static org.junit.Assert.assertThat; |
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/bash | |
email_addr="$1" | |
course_password="$2" | |
echo "${email_addr}" "${course_password}" | sbt |
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
task outputs() << { | |
tasks.each { task -> | |
println "${task.name}.outputs: ${task.outputs.getFiles().asType(Collection)}" | |
} | |
} |
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 TaskUtil { | |
static def recursivelyApplyToTaskDependencies(Task parent, Closure closure) { | |
closure(parent) | |
parent.dependsOn.findAll { dependency -> | |
dependency instanceof Task | |
}.each { task -> | |
recursivelyApplyToTaskDependencies(task, closure) | |
} | |
} |
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/bash -evx | |
PERFORCE_DEPOT_PATH=$1 | |
GIT_REPOSITORY_URL=$2 | |
git_project_name=$(echo ${GIT_REPOSITORY_URL} | sed -e 's|^.*/||' -e 's|\.git||') | |
rm -rf ${git_project_name} | |
git clone ${GIT_REPOSITORY_URL} |
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/bash -evx | |
PERFORCE_DEPOT_PATH=$1@all | |
GIT_REPOSITORY_URL=$2 | |
git_project_name=$(echo ${GIT_REPOSITORY_URL} | sed -e 's|^.*/||' -e 's|\.git||') | |
rm -rf ${git_project_name} | |
git clone ${GIT_REPOSITORY_URL} |
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
# Allows one to have a multi-line shebang just like in Scala. Just as in Scala, be sure to end the multi-line shebang with a !#. | |
# example usage: trampoline "${GRADLE_HOME}/bin/gradle" "$@" | |
function trampoline() { | |
local command=("$@") | |
umask 077 | |
tmpdir="$(mktemp -d -t $$.XXXXXXXXXXXXXXXX)" | |
trap 'rm -rf -- "${tmpdir}"' INT TERM HUP EXIT |
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
def doHttpPost(final String path, final String query) { | |
final authority = 'example.com' | |
final url = new URL("http://${authority}/${path}") | |
final connection = url.openConnection() | |
connection.with { | |
setRequestMethod('POST') | |
doOutput = true | |
final writer = new OutputStreamWriter(outputStream) | |
writer.with { |
OlderNewer