Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Jasper Frumau jasperf

🏠
Working from home
View GitHub Profile
@jasperf
jasperf / 1SyncOrderJob.php
Last active Jun 20, 2021
Exact Picquer PHP API Package Error on running Laravel Job: Could not acquire or refresh tokens [http 400]
View 1SyncOrderJob.php
<?php
namespace App\Jobs\Exact;
use App\Order;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
@jasperf
jasperf / elementor-swiper-slider.md
Last active May 30, 2021
Elementor Slider Pro with Swiper Slider issues using background images using CSS instead of HTML
View elementor-swiper-slider.md

See Swiper Slider Lazy Loading example. The Elementor Slider Widget Pro uses Swiper and basic setup uses background images with CSS [link]. They do not use HTML tags like <div> or <img> with src, data-src or srcset . To use lazy loading HTML markup has to be changed as shown in example.

With this HTML markup that we could also use Imagify to load webP images when possible using swapping with JavaScript. Unfortunately this is not possible with the current setup of Elementor Slider Pro.

@jasperf
jasperf / do-spaces-laravel-error.php
Last active Apr 25, 2021
Digital Ocean Spaces 503 Error using Laravel Backup
View do-spaces-laravel-error.php
<?php
app/Jobs/ProjectExport.php:46 App\Jobs\ProjectExport::handle
$zip = \Zip::create(storage_path("app/projects/{$name}"));
// Clean files
$allFiles = \Storage::disk('do_backup')->allFiles($storagePath);
@jasperf
jasperf / phpmyadmin.sh
Last active Apr 23, 2021
PHPMyAdmin on PHP 7.4 with Homebrew on macOS
View phpmyadmin.sh
~ brew install phpmyadmin
Updating Homebrew...
==> Downloading https://files.phpmyadmin.net/phpMyAdmin/5.1.0/phpMyAdmin-5.1.0-all-
######################################################################## 100.0%
==> Caveats
To enable phpMyAdmin in Apache, add the following to httpd.conf and
restart Apache:
Alias /phpmyadmin /usr/local/share/phpmyadmin
<Directory /usr/local/share/phpmyadmin/>
Options Indexes FollowSymLinks MultiViews
View site.conf
limit_req_zone $http_x_forwarded_for zone=three:20m rate=10r/s;
server {
server_name www.domain.com domain.com;
root /var/www/domain.com/htdocs;
index index.php;
access_log /var/log/nginx/domain.com.access.log;
error_log /var/log/nginx/domain.com.error.log;
client_max_body_size 100M;
@jasperf
jasperf / fberror.js
Last active Mar 6, 2021
Facebook __requireLazy____requireLazy__x__4 Error Firefox Developer
View fberror.js
ErrorUtils caught an error:
[Caught in: Module "__requireLazy____requireLazy__x__4"]
Subsequent non-fatal errors won't be logged; see https://fburl.com/debugjs. j9GU5_xjHTS.js:59:202
b https://static.xx.fbcdn.net/rsrc.php/v3/yv/r/j9GU5_xjHTS.js?_nc_x=RWdlEmtKlYm&_nc_eui2=AeFpZmcN_6Ci8snowGuHmkndRZIh_O4tUmpFkiH87i1SaqmDJ5-XpF6qeW77cv8No9vM8TwIvhLnAGeuygP24bgR:59
reportNormalizedError https://static.xx.fbcdn.net/rsrc.php/v3/yv/r/j9GU5_xjHTS.js?_nc_x=RWdlEmtKlYm&_nc_eui2=AeFpZmcN_6Ci8snowGuHmkndRZIh_O4tUmpFkiH87i1SaqmDJ5-XpF6qeW77cv8No9vM8TwIvhLnAGeuygP24bgR:61
applyWithGuard https://static.xx.fbcdn.net/rsrc.php/v3/yv/r/j9GU5_xjHTS.js?_nc_x=RWdlEmtKlYm&_nc_eui2=AeFpZmcN_6Ci8snowGuHmkndRZIh_O4tUmpFkiH87i1SaqmDJ5-XpF6qeW77cv8No9vM8TwIvhLnAGeuygP24bgR:64
F https://static.xx.fbcdn.net/rsrc.php/v3/yv/r/j9GU5_xjHTS.js?_nc_x=RWdlEmtKlYm&_nc_eui2=AeFpZmcN_6Ci8snowGuHmkndRZIh_O4tUmpFkiH87i1SaqmDJ5-XpF6qeW77cv8No9vM8TwIvhLnAGeuygP24bgR:43
A https://static.xx.fbcdn.net/rsrc.php/v3/yv/r/j9GU5_xjHTS.js
@jasperf
jasperf / trello-broken.js
Created Mar 1, 2021
Trello refuses to load on Firefox Developer every now and then NS Error File Corrupted
View trello-broken.js
Uncaught
Exception { name: "NS_ERROR_FILE_CORRUPTED",
message: "",
result: 2152857611,
filename: "https://a.trellocdn.com/prgb/dist/br/app.9f2bb7828af618560418.js",
lineNumber: 1,
columnNumber: 0,
data: null,
stack: "value@https://a.trellocdn.com/prgb/dist/br/app.9f2bb7828af618560418.js:1:2080422\nvalue@https://a.trellocdn.com/prgb/dist/br/app.9f2bb7828af618560418.js:1:2080282\nvalue@https://a.trellocdn.com/prgb/dist/br/app.9f2bb7828af618560418.js:1:1478610\ne@https://a.trellocdn.com/prgb/dist/br/app.9f2bb7828af618560418.js:1:1478250\n./packages/feature-flag-client/src/feature-flag-client.ts@https://a.trellocdn.com/prgb/dist/br/app.9f2bb7828af618560418.js:1:1481533\nb@https://trello.com/:37:8309\n./packages/feature-flag-client/index.ts@https://a.trellocdn.com/prgb/dist/br/app.9f2bb7828af618560418.js:1:1469269\nb@https://trello.com/:37:8309\n./packages/error-reporting/index.ts@https://a.trellocdn.com/prgb/dist/br/app.9f2bb7828af618560418.js:1:1459688\nb@https:/
@jasperf
jasperf / functions.php
Created Feb 12, 2021 — forked from mikejolley/functions.php
woocommerce_flat_rate_shipping_add_rate example for theme functions.php
View functions.php
<?php
add_action( 'woocommerce_flat_rate_shipping_add_rate', 'add_another_custom_flat_rate', 10, 2 );
function add_another_custom_flat_rate( $method, $rate ) {
$new_rate = $rate;
$new_rate['id'] .= ':' . 'next_day'; // Append a custom ID
$new_rate['label'] = 'Next Day'; // Rename to 'Rushed Shipping'
$new_rate['cost'] += 2; // Add $2 to the cost
@jasperf
jasperf / wgetwaybackmachinesite.sh
Last active Feb 12, 2021
Download website from web.archive.org or Wayback Machine
View wgetwaybackmachinesite.sh
# props https://tonyteaches.tech/download-wayback-machine-website/
wget --recursive --no-clobber --page-requisites --convert-links --domains web.archive.org --no-parent https://web.archive.org/web/20180314211747/https://website.com
@jasperf
jasperf / pod.yaml
Created Jan 10, 2021 — forked from matthewpalmer/pod.yaml
kubernetes nginx php-fpm pod
View pod.yaml
# Create a pod containing the PHP-FPM application (my-php-app)
# and nginx, each mounting the `shared-files` volume to their
# respective /var/www/html directories.
kind: Pod
apiVersion: v1
metadata:
name: phpfpm-nginx-example
spec:
volumes: