Skip to content

Instantly share code, notes, and snippets.

View michellescripts's full-sized avatar

Michelle Bergquist michellescripts

  • Denver, CO
View GitHub Profile
#!/usr/bin/env bash
database=${database:-some_database}
user=${user:-$database}
password=${password:-password}
while [ $# -gt 0 ]; do
if [[ $1 == *"--"* ]]; then
v="${1/--/}"
declare $v="$2"
# echo $1 $2 // Optional to see the parameter:value result
fi
#!/usr/bin/env bash
database=${database:-some_database}
test_database=${database:-some_test_database}
user=${user:-$database}
password=${password:-password}
while [ $# -gt 0 ]; do
if [[ $1 == *"--"* ]]; then
v="${1/--/}"
declare $v="$2"
# echo $1 $2 // Optional to see the parameter:value result
@michellescripts
michellescripts / KotlinGenericMaker
Created August 25, 2020 15:08
kotlin maker example for testing
## Make function (create in test directory)
inline fun <reified T> make(): T {
return makeInstanceOfClass(T::class) as T
}
fun makeInstanceOfClass(clazz: KClass<*>): Any? {
val primitive = makePrimitiveOrNull(clazz)
if (primitive != null) {
return primitive
@michellescripts
michellescripts / bin_check-resource
Created July 29, 2020 19:16
push script: rebase, run tests, git push
#!/usr/bin/env bash
set -xe
pushd ${PROJECT_DIR}
git pull -r && \
./gradlew build && \
git push
popd
@michellescripts
michellescripts / bin_cf-push
Created July 29, 2020 19:14
cf-push script
#!/usr/bin/env bash
set -xe
pushd ${PROJECT_DIR}
CURRENT_SPACE=$(cf target | grep space | cut -d":" -f2 | tr -d '[:space:]')
./gradlew clean build -x test && \
cf push -f cf/manifest.yml -p "./app/build/libs/app-0.0.1-SNAPSHOT.jar" --vars-file "cf/var-files/$CURRENT_SPACE.yml"
popd
@michellescripts
michellescripts / bin_ane-r-u-ok
Created July 29, 2020 19:13
ane-r-u-ok script
#!/usr/bin/env bash
ane && push
@michellescripts
michellescripts / bin_ane
Created July 29, 2020 19:13
ane script
#!/usr/bin/env bash
git commit --amend --no-edit
@michellescripts
michellescripts / gradle&kotlin pretty print tests
Created July 29, 2020 19:10
add to your build.gradle.kts to print your test results in a readable way!
tasks.withType<Test> {
systemProperty("junit.jupiter.execution.parallel.enabled", true)
testLogging {
// set options for log level LIFECYCLE
events(
TestLogEvent.FAILED,
TestLogEvent.PASSED,
TestLogEvent.SKIPPED,
@michellescripts
michellescripts / git-together
Last active August 8, 2019 19:43
git it together
git-together: https://github.com/kejadlen/git-together
Run `brew install pivotal/tap/git-together`
Add `alias git=git-together` to `~/.bash_profile` and source it
Make a new file in ~ called `.git-together`
Run `git config --global --add include.path ~/.git-together` to set the global file
- Will need to be run in ALL repos using that file^^^
Run `git config --file .git-together --add git-together.domain pivotal.io` to set the global domain
brew install openjdk@11
brew link openjdk@11 --force