Skip to content

Instantly share code, notes, and snippets.

View AlexSJ's full-sized avatar

Alex Sandro Juchem AlexSJ

View GitHub Profile
@AlexSJ
AlexSJ / wsl2-rootless-docker.md
Created November 8, 2025 19:08 — forked from espresso3389/wsl2-rootless-docker.md
WSL2 configuration for developing using rootless docker

NOTE: WORK IN PROGRESS

WSL2 configuration for developing using rootless docker

This document assumes Windows Insider Preview Dev.

Install Ubuntu 22.04

Installing Ubuntu 22.04.1 LTS from Microsoft Store.

@AlexSJ
AlexSJ / .env
Created July 9, 2024 15:29
Hyperf Proxy
DOCKER_USER=1000
DOCKER_UID=1000
# --- base php ---
FROM php:8.1-fpm as base-php
ENV TZ="America/Sao_Paulo"
WORKDIR /app
# --- composer build ---
FROM base-php as composer
COPY ./ /app
@AlexSJ
AlexSJ / alterar-terminal.sh
Last active August 4, 2024 17:01
Exibir nome do git branch no terminal linux
# Abrir o arquivo ~/.bashrc e colar a função a baixo e a variável PS1
# Pode colar no final dele
# Fechar e abrir o terminal ou simplesmente `source ~/.bashrc`
function parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
PS1='\[\033[0;32m\]\[\033[0m\033[0;32m\]\u\[\033[0;36m\]\w\[\033[01;33m\]$(parse_git_branch)\n\[\033[0;32m\]└─\[\033[0m\033[0;32m\] \$\[\033[0m\033[0;32m\] ▶\[\033[0m\] '
version: "3.1"
services:
postgres:
image: postgres:9.4
container_name: miglog-postgres
volumes:
- pgdata:/var/lib/postgresql/data
environment:
- POSTGRES_USER=postgres
<?php
$server = "{" . $this->configs['imap_servidor'] . ":" . $this->configs['imap_porta'] . ($this->configs['imap_comunicacao_segura'] == 'f' ? '/novalidate-cert' : '') . "}";
@AlexSJ
AlexSJ / sql
Created October 16, 2018 19:20
SELECT d.id
FROM solucoesglobais."at_debito" d
LEFT JOIN solucoesglobais."at_base" b ON b.id = d.id_base
LEFT JOIN solucoesglobais."at_divida" div ON div.id = d.id_divida
LEFT JOIN solucoesglobais."un_unico" u ON u.codigo = COALESCE (d.id_unico, b.id_unico)
WHERE d.id_divida IN ('1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '60', '61', '62', '63', '64', '65', '66', '67', '70', '90', '91', '92', '93', '94', '95', '101', '102', '103', '106', '107', '108', '110', '113', '114', '115', '116', '118', '119', '120', '121', '122', '123', '124', '125', '126', '127', '128', '129', '132', '133', '134', '135', '136', '137', '139', '140', '141', '142', '144', '145', '146', '160', '161', '162', '163', '164', '301', '303', '305', '
{
"workbench.colorTheme": "GitHub Plus",
"workbench.iconTheme": "material-icon-theme",
"editor.minimap.enabled": false,
"editor.fontSize": 13,
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 2000,
"editor.renderWhitespace": "all",
"files.autoGuessEncoding": true,
"window.zoomLevel": -1,
@AlexSJ
AlexSJ / gist:c0bbcfc50f7d95db8392f02878503929
Last active April 19, 2021 18:38
Terminal ubunut com cores ...
export PS1='\[\033[0;32m\]\[\033[0m\033[0;32m\]\u@\h \[\033[0;36m\]\w\[\033[0;32m\]$(__git_ps1)\n\[\033[0;32m\]└─\[\033[0m\033[0;32m\] \$\[\033[0m\033[0;32m\] ▶\[\033[0m\] '
@AlexSJ
AlexSJ / postgres_queries_and_commands.sql
Created January 16, 2018 13:07 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), 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(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'