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
| # Check if the current cluster is right | |
| kubectl config current-context | |
| # Get the current context access token | |
| TOKEN=$(kubectl describe secret $(kubectl get secrets | grep ^default | cut -f1 -d ' ') | grep -E '^token' | cut -f2 -d':' | tr -d " ") | |
| # Print it :) | |
| echo $TOKEN | |
| # More info: https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/ |
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
| // https://stackoverflow.com/questions/51609922/how-to-drill-down-charts-with-chartjs | |
| // https://stackoverflow.com/questions/26257268/click-events-on-pie-charts-in-chart-js | |
| $(document).ready(function() { | |
| var canvas = document.getElementById("myChart"); | |
| var ctx = canvas.getContext("2d"); | |
| var myNewChart = new Chart(ctx, { | |
| type: 'pie', | |
| data: data | |
| }); |
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
| web: MIX_ENV=prod mix phx.server |
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/sh | |
| # based on https://gist.github.com/ipedrazas/9c622404fb41f2343a0db85b3821275d | |
| # delete all evicted pods from all namespaces | |
| kubectl get pods --all-namespaces | grep Evicted | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod | |
| # delete all containers in ImagePullBackOff state from all namespaces | |
| kubectl get pods --all-namespaces | grep 'ImagePullBackOff' | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod | |
| # delete all containers in ImagePullBackOff or ErrImagePull or Evicted state from all namespaces |
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
| path | |
| |> CsvParser.parse(:stream) | |
| |> Flow.from_enumerable() | |
| |> Flow.map(&cast_contract/1) # will return {:ok, %Contract{}} | {:error, changeset} | |
| |> Flow.map(&apply_blacklist/1) # will return {:ok, %Contract{}} | {:error, changeset} | {:filtered, reason} | |
| |> Flow.partition(key: {:elem, 0}) | |
| |> Flow.group_by(& elem(&1, 0)) | |
| |> Flow.filter(fn | |
| {:error, changeset} -> log_error(changeset) && false | |
| {:filtered, reason} -> log_filtered(reason) && false |
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
| curl -X POST 'https://staging.ebanx.com.br/ws/direct' \ | |
| -d 'request_body={ | |
| "integration_key": "<bcredi-integration-key>", | |
| "operation": "request", | |
| "payment": { | |
| "name": "José Silva", | |
| "email": "[email protected]", | |
| "document": "853.513.468-93", | |
| "address": "Rua E", | |
| "street_number": "1040", |
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
| @statuses %{ | |
| "1.0 Cobrança Jurídica" => %{ | |
| "Leilão" => {:foreclosure_auction, "auction_in_progress"}, | |
| "Tentativa de Negociação" => {:notification, "attempt_to_negotiate"}, | |
| "Não Notificar (Casos de exceção)" => {:notification, "not_notify"} | |
| }, | |
| "1.1 Notificação" => %{ | |
| "Emissão" => {:notification, "notification_in_progress"}, | |
| "Envio e Custas" => {:notification, "notification_in_progress"}, | |
| "Análise do Cartório" => {:notification, "notification_in_progress"}, |
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
| SPC | |
| SPC: find file | |
| , switch buffer | |
| . browse files | |
| : MX | |
| ; EX | |
| < switch buffer | |
| ` eval | |
| u universal arg | |
| x pop up scratch |
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
| helm init | |
| kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller | |
| kubectl create serviceaccount --namespace kube-system tiller | |
| kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}' |
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
| @contract_mappings %{ | |
| external_id: %{ | |
| field: "NUMERO_CONTRATO", | |
| type: :string | |
| }, | |
| enterprise_name: %{ | |
| field: "NOME_EMPREENDIMENTO", | |
| type: :string | |
| }, | |
| enterprise_id: %{ |