Skip to content

Instantly share code, notes, and snippets.

View jasperf's full-sized avatar
🏠
Working from home

Jasper Frumau jasperf

🏠
Working from home
View GitHub Profile
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 March 6, 2021 01:54
Facebook __requireLazy____requireLazy__x__4 Error Firefox Developer
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 March 1, 2021 00:34
Trello refuses to load on Firefox Developer every now and then NS Error File Corrupted
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 February 12, 2021 08:40 — forked from mikejolley/functions.php
woocommerce_flat_rate_shipping_add_rate example for theme 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 February 12, 2021 00:32
Download website from web.archive.org or Wayback Machine
# 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 January 10, 2021 23:38 — forked from matthewpalmer/pod.yaml
kubernetes nginx php-fpm pod
# 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:
@jasperf
jasperf / htaccess: Boilerplate
Created October 1, 2020 01:07 — forked from landru247/htaccess: Boilerplate
htaccess: Boilerplate
# BEGIN HTML5 Boilerplate
###
### This contains the HTML5 Boilerplate .htaccess that can be found at:
### https://github.com/h5bp/server-configs/blob/master/apache/.htaccess
###
### Added:
### Block access to WordPress files that reveal version information.
###
### Removed:
@jasperf
jasperf / tabs.php
Created September 18, 2020 02:34 — forked from johnmccole/tabs.php
Add the below file to yourtheme/woocommerce/single-product/tabs/tabs.php. This will update the tabs to be an accordion. Update as required.
<?php
/**
* Single Product tabs
*
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/tabs/tabs.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
@jasperf
jasperf / class-walker-nav-menu.php
Created September 14, 2020 08:27 — forked from ezetojo/class-walker-nav-menu.php
Tailwind Navigation Implementation for Wordpress
<?php
/**
* Nav Menu API: Walker_Nav_Menu class
*
* @package WordPress
* @subpackage Nav_Menus
* @since 4.6.0
*/
/**
@jasperf
jasperf / delete_git_submodule.md
Last active May 31, 2020 06:44 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule <name>"
  • Delete the now untracked submodule files rm -rf path_to_submodule