Skip to content

Instantly share code, notes, and snippets.

View brunoalfred's full-sized avatar
🤌
Believe

Bruno Alfred brunoalfred

🤌
Believe
View GitHub Profile

Setup location to install chrome

sudo mkdir -p /var/www/.puppeteer-cache
sudo chown -R www-data:www-data /var/www/.puppeteer-cache

Install chrome using command

PUPPETEER_CACHE_DIR=/var/www/.puppeteer-cache npx puppeteer browsers install chrome
@brunoalfred
brunoalfred / file-splitting.php
Created March 4, 2022 06:37
Function to perform file splitting in php.
<?php
/**
* A file splitter function for php
* Can split a file to number of parts depending on the buffer size given
*
* @param $file String
* Path of the file to split
* @param $buffer number
* The [maximum] size of the part of a file
* @return array S

Make sure to pull the filepond package using your favourite means, i'll choose CDN, so the view looks like this:

<x-guest-layout>
    <x-auth-card>

        <x-slot name="logo">
            <a href="/">
                <x-application-logo class="w-20 h-20 fill-current text-gray-500"/>
            </a>
@brunoalfred
brunoalfred / extension_methods.dart
Created November 14, 2021 12:05
Basics of Dart extension.
extension StringExtension on String {
bool get isValidEmail {
final emailRegExp = RegExp(r"^[a-zA-Z0-9.]+@[a-zA-Z0-9]+\.[a-zA-Z]+");
return emailRegExp.hasMatch(this);
}
/*
* In Documentation its supported with implementation as :
*
* String operator &(String other) => '$this $other';