Skip to content

Instantly share code, notes, and snippets.

View jsilverdev's full-sized avatar

Julio Rios jsilverdev

View GitHub Profile
@michabbb
michabbb / PestPHP architecture testing.php
Last active May 16, 2024 13:07
PestPHP architecture testing
<?php
/** @see https://www.linkedin.com/posts/ashleyjcallen_these-are-some-not-all-of-the-first-pest-activity-7191803157692190720-HAPK **/
test('strict types are used everywhere')
->expect('App')
->toUseStrictTypes();
test('globals')
->expect(['dd', 'ddd', 'die', 'dump', 'ray', 'sleep'])
@cosmastech
cosmastech / Builder.php
Created December 23, 2023 17:24
Insert With Casts Example
<?php
use Illuminate\Database\Eloquent\Builder;
class BaseEloquentBuilder extends Builder
{
public function insertWithCasts(iterable $values): bool
{
if (empty($values)) {
return true;
@irazasyed
irazasyed / outbound-email-with-cloudflare.md
Last active July 27, 2024 02:34
Using Gmail SMTP with Cloudflare Email Routing: A Step-by-Step Guide

Using Gmail SMTP with Cloudflare Email Routing: Step-by-Step Guide

Learn how to send emails through Gmail SMTP with Cloudflare Email Routing in this comprehensive guide.

Step 1: Enable 2-Factor Authentication

To proceed with this method, ensure that you have enabled two-factor authentication for your Google account. If you haven't done so already, you can follow the link to set it up → Enable 2FA in your Google account.

Step 2: Create an App Password for Mail

extension on WidgetTester {
Future<void> launchApp() async {
await app.main();
await pumpAndSettle();
}
Future<void> clearState() async {
await SharedPreferences.getInstance().then((it) => it.clear());
}
@noseratio
noseratio / remove-unwanted-windows11-apps.ps1
Last active May 22, 2024 12:40
Windows 11 autorun resident apps that I have to remove manually
# Teams 2.0 (no work account support yet)
winget uninstall MicrosoftTeams_8wekyb3d8bbwe
# Your Phone
winget uninstall Microsoft.YourPhone_8wekyb3d8bbwe
# Widgets (Web Experience Pack)
winget uninstall MicrosoftWindows.Client.WebExperience_cw5n1h2txyewy
# Cortana
@FernandoLoureiroDeAraujo
FernandoLoureiroDeAraujo / configure-checkpoint-vpn-archlinux.md
Last active June 3, 2024 17:29
Configure CheckPoint VPN ArchLinux

Configure CheckPoint VPN ArchLinux

First install this packages:

Yes they have to be 32bits, this is important.

sudo pacman -Sy lib32-pam lib32-libx11 lib32-gcc-libs lib32-nss nss

Then install this package from AUR:

Script that will trigger a local to remote sync when any changes below your local Google Drive folder occur - but at max. every 10 minutes - and a remote to local sync every x (e.g. 30 minutes) via a cron job.
0. Install rclone and configure it for Google Drive
1. Create files listed below
2. Configure rclone_watch_local.sh to be run on startup (e.g. using a systemd service unit)
3. Add a cron job that runs rclone_remote2local.sh every x (e.g. 30) minutes
----------------------
rclone_local2remote.sh
----------------------
@sajithneyo
sajithneyo / bracket-pair-colorizer-2-settings
Created June 25, 2019 14:23
Settings you need for bracket pair colorizer 2
{
"bracket-pair-colorizer-2.colors": [
"Gold",
"Orchid",
"LightSkyBlue",
"Salmon",
"LawnGreen",
"DarkOrange",
"Cornsilk"
],
@ryderdamen
ryderdamen / gce-to-gcs-uploads.md
Created December 4, 2018 15:43
Uploading Files from Google Compute Engine (GCE) VMs to Google Cloud Storage (GCS)

Uploading Files from Google Compute Engine (GCE) VMs to Google Cloud Storage (GCS)

I had a bit of trouble trying to configure permissions to upload files from my Google Compute Engine instance to my Google Cloud Storage bucket. The process isn't as intuitive as you think. There are a few permissions issues that need to be configured before this can happen. Here are the steps I took to get things working.

Let's say you want to upload yourfile.txt to a GCS bucket from your virtual machine. You can use the gsutil command line tool that comes installed on all GCE instances.

If you've never used the gcloud or gsutil command line tools on this machine before, you will need to initialize them with a service account.

@muety
muety / rclone_sync.txt
Last active December 20, 2022 20:32
Automated Google Drive sync for Linux using rclone
Script that will trigger a local to remote sync when any changes below your local Google Drive folder occur - but at max. every 10 minutes - and a remote to local sync every x (e.g. 30 minutes) via a cron job.
0. Install rclone and configure it for Google Drive
1. Create files listed below
2. Configure rclone_watch_local.sh to be run on startup (e.g. using a systemd service unit)
3. Add a cron job that runs rclone_remote2local.sh every x (e.g. 30) minutes
----------------------
rclone_local2remote.sh
----------------------