Skip to content

Instantly share code, notes, and snippets.

Clairton Luz clairtonluz

Block or report user

Report or block clairtonluz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View print-element-by-id.js
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;
}
View gradle.properties
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
View runner.sh
# 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
View docker-compose.yml
version: "3.7"
services:
db:
image: postgres
environment:
POSTGRES_USER: example
POSTGRES_DB: example
POSTGRES_PASSWORD: example
app:
View wait-for-migration.sh
#!/bin/sh
# wait-for-migration.sh
set -e
cmd="$@"
echo "cmd: $cmd"
until npx sequelize db:migrate; do
View settings.json
{
"files.autoSave": "onFocusChange",
"workbench.startupEditor": "newUntitledFile",
"window.zoomLevel": 0,
"editor.fontFamily": "Fira Code",
"editor.fontSize": 18,
"editor.fontLigatures": true,
"editor.renderLineHighlight": "gutter",
"editor.tabSize": 2,
"editor.rulers": [
View postgres_queries_and_commands.sql
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
View example.dart
MapUtils.openMap(-3.823216,-38.481700);
View map_utils.dart
import 'package:url_launcher/url_launcher.dart';
class MapUtils {
static openMap(double latitude, double longitude) async {
String googleUrl = 'https://www.google.com/maps/search/?api=1&query=$latitude,$longitude';
if (await canLaunch(googleUrl)) {
await launch(googleUrl);
} else {
throw 'Não foi possível abrir o mapa.';
}
View show_connections.sh
#!/bin/bash
HOST='localhost'
PORT='5432'
USERNAME='postgres'
PASSWORD='postgres'
DATABASE='postgres'
while test $# -gt 0; do
case "$1" in
--help)
You can’t perform that action at this time.