Skip to content

Instantly share code, notes, and snippets.

# set JAVA_HOME on every change directory while using asdf-vm
function asdf_update_java_home {
asdf current java 2>&1 > /dev/null
if [[ "$?" -eq 0 ]]
then
export JAVA_HOME=$(asdf where java)
fi
}
precmd() { asdf_update_java_home; }
# Programas
.c - C and C++ source code file
.cgi and .pl - Perl script file.
.class - Java class file
.cpp - C++ source code file
.cs - Visual C# source code file
.h - C, C++, and Objective-C header file
.java - Java Source code file
.php - PHP script file.
.py - Python script file.
@clairtonluz
clairtonluz / gist:e4355a0fd0ae501754fdb5561e483dfc
Created September 3, 2020 14:02
whitelist-file-extension.txt
# Imagens
.ai - Adobe Illustrator file
.bmp - Bitmap image
.gif - GIF image
.ico - Icon file
.jpg - JPEG image
.jpeg - JPEG image
.png - PNG image
.ps - PostScript file
.psd - PSD image
@clairtonluz
clairtonluz / index.html
Last active June 19, 2020 13:58
Imagem de fallback
<!-- example 1 -->
<img src="/imagem_principal.png" onerror="this.src='/imagem_de_fallback.png';this.onerror='';"/>
<!-- example 2 -->
<object data="/imagem_principal.png" type="image/png">
<img src="/imagem_de_fallback.png"/>
</object>
// veja como funciona a sintaxy https://ss64.com/bash/syntax-prompt.html
// veja os valores das colors https://ss64.com/bash/tput.html
// retorna o nome do branch entre [] cochetes
git_branch() {
branchName=$(git branch 2>/dev/null | grep '^*' | colrm 1 2)
if [ ! -z "$branchName" ]; then
echo "[$branchName]"
fi
function printById(elementId) {
var popup = window.open();
popup.document.write(document.getElementById(elementId).outerHTML);
popup.focus(); //required for IE
popup.print();
popup.close();
return true;
}
systemProp.http.proxyUser=clairton
systemProp.https.proxyUser=clairton
systemProp.http.proxyPassword=yourPassword
systemProp.https.proxyPassword=yourPassword
systemProp.https.proxyHost=proxy.clairtonluz.com.br
systemProp.http.proxyHost=proxy.clairtonluz.com.br
systemProp.http.proxyPort=8080
systemProp.https.proxyPort=8080
systemProp.http.nonProxyHosts=localhost, 127.0.0.1, *.local
systemProp.https.nonProxyHosts=localhost, 127.0.0.1, *.local
# cria o runner no docker
docker run -d \
--name gitlab-runner \
--restart always \
-v gitlab-runner:/etc/gitlab-runner \
-v /var/run/docker.sock:/var/run/docker.sock \
gitlab/gitlab-runner:latest
# Entra no runner criado anteriormente
version: "3.7"
services:
db:
image: postgres
environment:
POSTGRES_USER: example
POSTGRES_DB: example
POSTGRES_PASSWORD: example
app: