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
Add 2FA enable confirmation using TOTP code | |
@package laravel/jetstream | |
--- src/Http/Livewire/TwoFactorAuthenticationForm.php | |
+++ src/Http/Livewire/TwoFactorAuthenticationForm.php | |
@@ -3,8 +3,9 @@ | |
namespace Laravel\Jetstream\Http\Livewire; | |
use Illuminate\Support\Facades\Auth; |
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
Adds option to confirm activation of 2FA | |
@package laravel/fortify | |
--- /dev/null | |
+++ database/migrations/2021_06_01_145800_add_two_factor_confirmed_column_to_users_table.php | |
@@ -0,0 +1,34 @@ | |
+<?php | |
+ | |
+use Illuminate\Database\Migrations\Migration; |
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
Add password hash in session to fix leave impersonate in Laravel 8 with jetstream | |
@package lab404/laravel-impersonate | |
--- src/Guard/SessionGuard.php | |
+++ src/Guard/SessionGuard.php | |
@@ -16,7 +16,9 @@ class SessionGuard extends BaseSessionGuard | |
public function quietLogin(Authenticatable $user) | |
{ | |
$this->updateSession($user->getAuthIdentifier()); |
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
# Resize images in folder | |
$ npm install sharp-cli | |
$ find . -name '*.jpg' | gawk -F'.jpg' '{ printf "sharp -i \"%s\" -o ./%s-thumb.jpg resize 321 485\n", $0, $1 }' | bash | |
# Rename folder image in sequential order | |
$ find . -name '*.jpg' | gawk 'BEGIN{ a=1 }{ printf "mv \"%s\" %d.jpg\n", $0, a++ }' | bash |
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
# create assets folder in the current project | |
$ mkdir android/app/src/main/assets | |
# create bundle script | |
$ react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/ | |
# execute command to run android to create debug apk | |
$ react-native run-android | |
# change to android folder |
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
<?php | |
function validaCpf($cpf) { | |
$cpf = preg_replace("/\D+/", "", $cpf); | |
if(strlen($cpf) < 11 || count(array_count_values(str_split($cpf))) === 1) { | |
return false; | |
} | |
for ($t = 9; $t < 11; $t++) { | |
for ($dv = 0, $c = 0; $c < $t; $c++) { | |
$dv += $cpf[$c] * (($t + 1) - $c); | |
} |
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
This results in a single line of package names that can be easily added to a sudo apt-get purge command. | |
cat /var/log/dpkg.log |awk '/ install / {printf "%s ",$4 }' |