Skip to content

Instantly share code, notes, and snippets.

View patrickmaciel's full-sized avatar
🙏
Jesus is coming!

Patrick Maciel patrickmaciel

🙏
Jesus is coming!
View GitHub Profile
@patrickmaciel
patrickmaciel / package.json
Last active November 5, 2022 05:06
React Native Expo WSL2 Fix Ip Address QR Code
{
"scripts": {
"startwsl": "REACT_NATIVE_PACKAGER_HOSTNAME=$(netsh.exe interface ip show address 'Wi-Fi 2' | grep 'IP Address' | sed -r 's/^.*IP Address:\\W*//') expo start",
}
}
@patrickmaciel
patrickmaciel / keychron_linux.md
Created August 19, 2022 17:03 — forked from andrebrait/keychron_linux.md
Keychron keyboards on Linux + Bluetooth fixes

Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.

Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.

Make Fn + F-keys work

Keychron Keyboards on Linux use the hid_apple driver (even in Windows/Android mode), both in Bluetooth and Wired modes. By default, this driver uses the F-keys as multimedia shortcuts and you have to press Fn + the key to get the usual F1 through F12 keys.

@patrickmaciel
patrickmaciel / linux-wsl-instructions.md
Last active November 13, 2024 14:29
Instructions to fully configure your Ubuntu/Linux machine with all needed tools to code (mainly in PHP/Laravel)

Instructions

Linux essentials

sudo apt update && sudo apt-upgrade -y
sudo apt install wget curl vim -y

@patrickmaciel
patrickmaciel / notification-livewire-alpine.html
Created December 7, 2021 02:21
Livewire Alpine Helpers
<!-- listen notify-saved then show a span with messages that vanish in 1000ms -->
<span x-cloak x-data="{ open: false, message: '' }" x-init="@this.on('notify-saved', () => { setTimeout(() => { open = false }, 2500); open = true;
}) " x-show='open' x-transition.out.duration.1000ms class="text-green-600">Salvo com sucesso!</span>
@patrickmaciel
patrickmaciel / default.conf
Last active May 6, 2022 22:57
p4dev - setup debian server with php mysql (mariadb) nginx composer
server {
listen 80;
listen [::]:80;
server_name localhost;
root /var/www/html;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
@patrickmaciel
patrickmaciel / desktop-vscode-settings.json
Last active September 27, 2021 18:53
desktop-vscode-settings.json
{
/**
* Better Defaults
**/
"editor.copyWithSyntaxHighlighting": false,
"diffEditor.ignoreTrimWhitespace": false,
"editor.emptySelectionClipboard": false,
"window.newWindowDimensions": "inherit",
"editor.multiCursorModifier": "ctrlCmd",
"files.trimTrailingWhitespace": true,
@patrickmaciel
patrickmaciel / nginx_serverblock
Created April 25, 2021 14:30
nginx proxy to react app
server {
listen 80;
server_name yourdomain;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://localhost:3333/;
proxy_ssl_session_reuse off;
@patrickmaciel
patrickmaciel / configuracoes.md
Created April 18, 2021 00:30
Laragon + Mailhog
@patrickmaciel
patrickmaciel / .php_cs
Created March 4, 2020 02:11
PHPCS Fixer .php_cs Laravel 5+
<?php
return PhpCsFixer\Config::create()
->setRules(array(
'@Symfony' => true,
'@PSR1' => true,
'@PSR2' => true,
'yoda_style' => false,
'binary_operator_spaces' => true,
'blank_line_after_namespace' => true,
@patrickmaciel
patrickmaciel / upgrade-php7.sh
Created February 28, 2020 14:29 — forked from skynet/upgrade-php7.sh
Upgrade PHP to 7.3 on Amazon Linux (specifically for Elastic Beanstalk but should work elsewhere)
#!/usr/bin/env bash
# Upgrade an Amazon Linux EC2 to PHP 7.3
#
# Last tested w/ PHP 7.2 AWS Linux version 2.8.5
#
# Must be ran as sudo:
# sudo bash upgrade-php7.sh
#
# Can be added to ./.ebextensions/20_php.config like so:
# container_commands: