Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Jasper Frumau jasperf

🏠
Working from home
View GitHub Profile
@jasperf
jasperf / wget-download-site.sh
Last active Sep 10, 2021
Use wget to get a local copy of a site with all files and folders . This an ideal way to clone a (static html/css/javascript based ) site from the command line. #copy #clone #wget #download
View wget-download-site.sh
#http://stackoverflow.com/questions/6348289/download-a-working-local-copy-of-a-webpage
#http://stackoverflow.com/questions/8755229/how-to-download-all-file-from-website-using-wget
#http://stackoverflow.com/questions/4272770/wget-with-authentication?rq=1
#add browser headers:
#--header="Accept: text/html" --user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 Firefox/30.0"
#add .htaccess authentication details:
#--password=password --user=user
wget -m -p -E -k -K -np http://site/path/
wget -p -k http://ExampleSite.com
# and another via Quora https://www.quora.com/How-do-you-export-a-WordPress-site-to-a-static-HTML
View woocommerce-featured-products.php
@jasperf
jasperf / cf7.css
Last active Aug 23, 2021 — forked from codehandling/cf7.css
Contact Form 7 Styles for basic CSS styling of the form. Form is responsive and has nice rounded corners. For labels and placeholders you need to edit the form in CF7 https://imwz.io/contact-form-7-css-boilerplate/
View cf7.css
/*
** Contact Form 7 basics
**
**/
/* Form width and border */
.wpcf7 {
text-align: left;
width: 90%;
@jasperf
jasperf / lookforbadguys.php
Created Jul 28, 2012
Look for Bad Guys By Karen Chun, Steven Whitney #security #php
View lookforbadguys.php
<?php
/* lookforbadguys.php 2011-09-27
Copyright (C)2011 Karen Chun, Steven Whitney.
Initially published by http://25yearsofprogramming.com.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License (GPL)
Version 3 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@jasperf
jasperf / tar-and-gzip-site files.sh
Last active Jul 12, 2021
Backup your site's files using tar and gzip from the command line. #tar #gzip #backup
View tar-and-gzip-site files.sh
## No dash "-" with this order destination origin and on gnu os like DH Ubuntu
## http://unix.stackexchange.com/questions/13573/why-use-superflous-dash-to-pass-option-flags-to-tar
## Destination - origin unlike scp
tar cvzf sitecom.tar.gz directoryname
## And to empty directory
rm -r /path/to/directory/*
## And to exclude a directory while backing up use
## Make sure not to add a trailing slash!
tar cvzf site.com.tar.gz site.com/ --exclude=site.com/wp-content/uploads/backupbuddy_backups
@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 / home-brew-mysql-essential-commands
Last active Jun 15, 2021
Homebrew Create a MySQL database and user to be used for a WordPress site from the command line with mysql and restart server when you have a socket error or other error #wordpress #mysql #homebrew
View home-brew-mysql-essential-commands
//homebrew mysql start
/usr/local/Cellar/mysql/5.6.19/bin/mysql.server restart
//or
mysql.server start
//check for access privileges
mysqlaccess localhost user database
@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