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
# how-to checkout, aka start working on another branch | |
git checkout another-non-current-branch-name | |
# how-to checkout, aka start working on another branch and overwrite all changes !!! | |
git checkout another-non-current-branch-name --force | |
# how-to get a file from another branch ( herewith develop ) | |
git checkout develop -- src/main/scala/com/company/path/to/class/CoolTrait.scala | |
# how-to get a file from another branch ( herewith develop ) and overwrite it |
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
# save your current working copy into the git stash | |
git stash | |
# check what there is in the git stash | |
git stash list | |
# how-to remove a stash item | |
git stash drop stash@{0} | |
# how-to pick a git stash |
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
digraph { | |
label=" \n\n simplified workflow \n control flow diagram "; | |
edge[color=maroon,arrowsize=.7 ,len=2.0]; | |
node[shape=box,style="filled,rounded",color=cornflowerblue,fontcolor=white, fontsize=12, fixedsize=true,width = 6.0, height = .75]; | |
node[shape="diamond",style="filled",color=cornflowerblue,fontcolor=white, fontsize=12,fixedsize=true,width = 7.0, height = .75 ]; | |
node[shape="circle", style="filled,rounded",color=cornflowerblue,fontcolor=white, fontsize=12, fixedsize=true,width = 1.25 ]; | |
start_workflow[shape="circle",label="start the \n workflow"]; | |
landing_dir[shape="box", label=" scan the \n landing dir "]; | |
workflow_stop_on_conf_error[shape="circle", label="workflow stop"]; |
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
# how-to rebase your feature branch into develop quickly | |
# check the status | |
git status | |
# check the git log | |
git log --pretty --format='%h %ai %<(15)%an ::: %s' | |
# set your current branch , make a backup of it , caveat minute precision | |
curr_branch=$(git rev-parse --abbrev-ref HEAD); git branch "$curr_branch"--$(date "+%Y%m%d_%H%M"); git branch -a | grep $curr_branch | sort -nr |
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
try { | |
throw new CustomValidationException1( CustomErrorCode.STUPID_FAIL_1 | |
"could be throw new CustomValidationException2") | |
} catch { | |
case e | |
if (e.isInstanceOf[CustomValidationException1] || e | |
.isInstanceOf[CustomValidationException2]) => { | |
// run a common handling for the both custom exceptions | |
println(e.getMessage) | |
println(e.errorCode.toString) // an example of common behaviour |
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 bash | |
set +x | |
echo "checking for own todo left-overs ... "$(grep -ri 'todo:ygeorgie' . | grep -v 'pre-commit' | wc -l)" found." | |
grep -rnHi 'todo:ygeorgie' . | grep -v 'pre-commit' | |
sleep 2 | |
set -e | |
echo "running scalafmt tasks ..." |
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
realm=Artifactory Realm | |
host=company-artifactory.net | |
user=cuser | |
password=cpwd | |
// eof file /Users/phz/.ivy2/credential | |
// check also the following file: ~/.sbt/0.13/credentials.sbt |
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 org.apache.hadoop.fs.{FileAlreadyExistsException, FileSystem, FileUtil, Path} | |
val srcFileSystem: FileSystem = FileSystemUtil | |
.apply(spark.sparkContext.hadoopConfiguration) | |
.getFileSystem(sourceFile) | |
val dstFileSystem: FileSystem = FileSystemUtil | |
.apply(spark.sparkContext.hadoopConfiguration) | |
.getFileSystem(sourceFile) | |
FileUtil.copy( |
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
// add some stats for each test | |
testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-oD") | |
// might or might not suits your reqs | |
fork in Test := true | |
// might or might not suit your reqs | |
parallelExecution in Test := false | |
// the verbosity level after issuing the sbt test command |
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
// pick randomly a file type to generate a valid dataframe for | |
val random = math.random | |
val randomType : RandomType = { | |
random match { | |
case a if (random >= 0 && random < 0.33) => { | |
RandomType.Type1 | |
} | |
case b if (random >= 0.33 && random < 0.66) => { | |
RandomType.Type2 | |
} |