This is an example of bash library usage. The library fail-fast if you try to use directly from CLI.
The library contains the shebang and execution permissions only for the examples. Not needed in production code (the shebaang and the permissions).
| // Idea from this tweet https://twitter.com/dei_biz/status/1572532695183523842?s=20&t=4VCKMl_BJSfWBETNhtyEbA | |
| // All credit to ttps://github.com/dei-biz | |
| [...document.querySelectorAll("*")].map(e=> http://e.style.color = "RGBA(0,0,0,0)") |
| # Alias to show git log with nice format. | |
| # then you can: | |
| # $ git lg | lg1 | |
| # $ git lg2 | |
| # To show the log | |
| # based on: https://stackoverflow.com/questions/1057564/pretty-git-branch-graphs | |
| [alias] | |
| lg1 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all | |
| lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all |
| # Put the Git branch in the prompt | |
| function parse_git_dirty { | |
| [[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" | |
| } | |
| function parse_git_branch { | |
| git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/" | |
| } | |
| export PS1='\[\033[1;34m\]\w\[\033[1;95m\]$(parse_git_branch)\[\033[0m\]$ ' |
| # Check if all executables needed are in the PATH before execite any rule/task. | |
| EXECUTABLES = rm mkdir cp mvn java go # List of executables | |
| CHECK_EXECUTABLES := $(foreach exec,$(EXECUTABLES),\ | |
| $(if $(shell which $(exec)),some string,$(error "No $(exec) in PATH. Check README.md for build requirements"))) | |
| # This must be at the begining of the file, so ASAP make parses the file will fail if some of | |
| # dependencies does not exist |
| module github.com/jomoespe/align-text | |
| go 1.13 | |
| require github.com/logrusorgru/aurora v0.0.0-20191116043053-66b7ad493a23 |
| # Non-privileged containers based on the scratch image | |
| # https://medium.com/@lizrice/non-privileged-containers-based-on-the-scratch-image-a80105d6d341 | |
| FROM ubuntu AS base | |
| RUN useradd -u 10001 user | |
| RUN mkdir /home/user | |
| FROM scratch | |
| COPY --from=base /etc/passwd /etc/passwd | |
| COPY --from=base /home/user /home/user |
This is an example of bash library usage. The library fail-fast if you try to use directly from CLI.
The library contains the shebang and execution permissions only for the examples. Not needed in production code (the shebaang and the permissions).
| val partitions = 5; // this value depends on data and volumes. Will be different in every case. | |
| val df = sqlContext.read.json(“URI://path/to/parquet/files/") | |
| df.createOrReplaceTempView("df") | |
| val df_output = spark | |
| .sql("SELECT DISTINCT * FROM df") // this removes duplicates. If it's not needed, simply remove this line | |
| .coalesce(partitions) | |
| df_output.write.parquet("URI://path/to/destination") |
| <html> | |
| <style type="text/css"> | |
| * { | |
| margin: 0; | |
| padding: 0; | |
| font-size: 10px; | |
| } | |
| div { | |
| display: flex; | |
| flex-direction: row; |
| <html> | |
| <style type="text/css"> | |
| * { | |
| margin: 0; | |
| padding: 0; | |
| } | |
| html { | |
| font-size: 62.5%; | |
| box-sizing: border-box; |