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
@jasperf
jasperf / index.html
Created September 7, 2024 00:54 — forked from JeffreyWay/index.html
Learn Vue 3: Step By Step - Episode 2, Attribute Binding and Event Handling - https://laracasts.com/series/learn-vue-3-step-by-step/episodes/2
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Episode 2: Attribute Binding and Basic Events</title>
<script src="https://unpkg.com/vue@3"></script>
<style>
html, body {
height: 100%;
}
@jasperf
jasperf / woocommerce_defer_transactional_emails.php
Created November 15, 2023 03:55 — forked from jessepearson/woocommerce_defer_transactional_emails.php
This will turn on deferred transactional emails in WooCommerce. This may help if you are experiencing slow checkouts or checkout timeouts.
<?php // Do not copy this line
/**
* This will turn on deferred transactional emails in WooCommerce. This may help if you
* are experiencing slow checkouts or checkout timeouts.
*/
add_filter( 'woocommerce_defer_transactional_emails', '__return_true' );
@jasperf
jasperf / wp-config.php
Last active November 15, 2023 02:35 — forked from JRyven/wp-config.php
WordPress Debugging Options
// general PHP and WordPress warnings, error messages and status information
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
define( 'WPS_DEBUG', true );
// script and style
define( 'WPS_DEBUG_SCRIPTS', true );
@jasperf
jasperf / color-palette-addition-acf-color-picker.php
Last active January 7, 2023 03:09 — forked from simplethemes/scripts.php
Customize the ACF color picker in your theme and have it load colors of your liking as swatches
<?php
/**
* Add brand color palette to acf color picker
* https://www.advancedcustomfields.com/resources/javascript-api/#filters-color_picker_args
*
*/
function kronos_acf_input_admin_footer() {
?>
<script type="text/javascript">
@jasperf
jasperf / index.html
Created January 3, 2023 01:55 — forked from ypn/index.html
Lazy Loading background images in CSS
<div id="container">
<h3>Lazy loading CSS background images</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam at ligula non lorem facilisis finibus. Suspendisse turpis lacus, tempus sit amet dignissim sit amet, pretium non sem. Ut malesuada purus ac magna placerat, tempus commodo turpis consectetur. Nunc vitae metus vehicula nunc congue varius. Suspendisse egestas urna non finibus feugiat. Vestibulum maximus, nunc et tempus convallis, dui ante vestibulum est, in lobortis purus sapien eget lacus. Suspendisse cursus enim non quam mollis imperdiet. Pellentesque convallis eget nunc vitae fringilla. Fusce interdum, velit semper varius aliquet, eros sapien facilisis erat, iaculis vulputate erat arcu vel neque. Suspendisse dignissim hendrerit lorem. Etiam metus ex, finibus vitae iaculis vitae, iaculis non ex. Phasellus commodo id ante id consequat. Nunc consectetur viverra lacus non fringilla. Pellentesque nec nisl vulputate, sagittis nisl id, venenatis nisi. Nunc malesuada tellus a elit s
<?php
/**
* Add login and logout links to main menu
*
* @param string $items The HTML list content for the menu items.
* @param obj $args An object containing wp_nav_menu() arguments.
*
* @link https://codex.wordpress.org/Function_Reference/wp_login_url
* @link https://codex.wordpress.org/Function_Reference/wp_logout_url
* @link https://developer.wordpress.org/reference/functions/wp_nav_menu/
@jasperf
jasperf / clear_gravity_form_default_values.js
Created September 25, 2022 08:26 — forked from BronsonQuick/clear_gravity_form_default_values.js
Clear default values in Gravity Forms and place them back in on blur if they are empty
jQuery(document).ready(function($) {
jQuery.fn.cleardefault = function() {
return this.focus(function() {
if( this.value == this.defaultValue ) {
this.value = "";
}
}).blur(function() {
if( !this.value.length ) {
this.value = this.defaultValue;
@jasperf
jasperf / find-base64-occurences
Created September 21, 2022 11:38 — forked from anotheremily/find-base64-occurences
hackers seem to like base64 encoding their php commands
#!/bin/bash
find . -name "*.php" -exec grep "base64" '{}' \; -print &> b64-detections.txt
find . -name "*.php" -exec grep "eval" '{}' \; -print &> eval-detections.txt
@jasperf
jasperf / deploy.sh
Created February 27, 2022 06:33 — forked from cagartner/deploy.sh
Laravel Push deploy Github actions example
#!/bin/sh
set -e
vendor/bin/phpunit
(git push) || true
git checkout production
git merge master
@jasperf
jasperf / memberpress-use-coupon-once-per-user.php
Created February 2, 2022 09:34 — forked from cartpauj/memberpress-use-coupon-once-per-user.php
User cannot use coupon more than once with MemberPress
<?php
function custom_validate_coupon($errors) {
global $wpdb;
//If user is not logged in, then they've never used a coupon before
if(!MeprUtils::is_user_logged_in()) { return $errors; }
$coupon_code = (isset($_POST['mepr_coupon_code']) && !empty($_POST['mepr_coupon_code']))?stripslashes($_POST['mepr_coupon_code']):'';
if(($coupon = MeprCoupon::get_one_from_code($coupon_code)) && isset($coupon->ID) && $coupon->ID) {