Skip to content

Instantly share code, notes, and snippets.

View emaia's full-sized avatar
👾

Emaia emaia

👾
View GitHub Profile
@emaia
emaia / api-deployer.php
Last active November 27, 2023 16:52
Simple CI/CD api script
<?php
use Hyperf\Nano\Factory\AppFactory;
use Hyperf\HttpServer\Contract\RequestInterface;
require_once __DIR__.'/vendor/autoload.php';
$app = AppFactory::create('0.0.0.0', 9051);
$app->post('/deployer/api/webhook/gh', function (RequestInterface $request) {
wsl.exe –terminate <Distro>
wsl –shutdown
diskpart
select vdisk file=%appdata%\..\Local\Local\Packages\SomeWSLVendorName\LocalState\ext4.vhdx
compact vdisk
exit
# For more information: https://laravel.com/docs/sail
version: '3'
services:
laravel.test:
build:
context: ./vendor/laravel/sail/runtimes/8.1
dockerfile: Dockerfile
args:
WWWGROUP: '${WWWGROUP}'
image: sail-8.1/app
// https://constantsolutions.dk/2020/06/delay-loading-of-google-analytics-google-tag-manager-script-for-better-pagespeed-score-and-initial-load/
document.addEventListener('DOMContentLoaded', () => {
/** init gtm after 3500 seconds - this could be adjusted */
setTimeout(initGTM, 3500);
});
document.addEventListener('scroll', initGTMOnEvent);
document.addEventListener('mousemove', initGTMOnEvent);
document.addEventListener('touchstart', initGTMOnEvent);
@emaia
emaia / .tmux.conf
Created December 24, 2021 17:46
Tmux custom settings
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split panes using | and -
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
@emaia
emaia / settings.json
Created November 30, 2021 21:37 — forked from ChrisFrontDev/settings.json
My windows terminal Settings (Dracula theme, Fira Code w/ font ligatures on, symbols on)
// This file was initially generated by Windows Terminal 1.0.1401.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
Compilar arquivos de tradução:
$ apt install gettext
$ msgcat pt_BR.po | msgfmt -o pt_BR.mo -
Excluir comentários (Spam) usando CLI
$ wp comment delete $(wp comment list --status=spam --format=ids)
$ wp comment delete $(wp comment list --status=hold --format=ids)
@emaia
emaia / qrcode-decode.py
Created June 2, 2021 15:33
Decodificar QR Code a partir de arquivos de imagens
# sudo apt install python-qrtools
import qrtools
import glob
images = sorted(glob.glob('./images/*.png'))
qr = qrtools.QR()
for image in images:
@emaia
emaia / gist:1f0fb131fc91b6c0e01711f746cae854
Created October 4, 2020 20:30
Estados Brasileiros - Formidable Forms (WordPress)
Acre|AC
Alagoas|AL
Amapá|AP
Amazonas|AM
Bahia|BA
Ceará|CE
Distrito Federal|DF
Espírito Santo|ES
Goiás|GO
Maranhão|MA
{
"states": [
{ "id": 11, "name": "Rondônia", "code" : "RO" },
{ "id": 12, "name": "Acre", "code" : "AC" },
{ "id": 13, "name": "Amazonas", "code" : "AM" },
{ "id": 14, "name": "Roraima", "code" : "RR" },
{ "id": 15, "name": "Pará", "code" : "PA" },
{ "id": 16, "name": "Amapá", "code" : "AP" },
{ "id": 17, "name": "Tocantins", "code" : "TO" },
{ "id": 21, "name": "Maranhão", "code" : "MA" },