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 / functions.php
Created February 8, 2020 00:02 — forked from hirejordansmith/functions.php
Add support for ACF custom fields to WooCommerce Attributes
<?php
// Adds a custom rule type.
add_filter( 'acf/location/rule_types', function( $choices ){
$choices[ __("Other",'acf') ]['wc_prod_attr'] = 'WC Product Attribute';
return $choices;
} );
// Adds custom rule values.
add_filter( 'acf/location/rule_values/wc_prod_attr', function( $choices ){
@jasperf
jasperf / custom-woo-acf-tabs.php
Created February 7, 2020 23:49 — forked from ajmorris/custom-woo-acf-tabs.php
Create custom product details tabs within WooCommerce using an ACF (Advanced Custom Fields) Repeater field.
<?php
function hwid_load_custom_tab( $tab_key, $tab_info ) {
echo apply_filters( 'the_content', $tab_info['tabContent'] );
}
function hwid_add_content_tabs( $tabs ) {
global $post;
$custom_tabs = get_field( 'tabs', $post->ID );
@jasperf
jasperf / acf-fields.php
Created February 7, 2020 23:47 — forked from ajmorris/acf-fields.php
Create custom product details tabs within WooCommerce using an ACF (Advanced Custom Fields) Repeater field.
<?php
if( function_exists('acf_add_local_field_group') ):
acf_add_local_field_group(array (
'key' => 'acf_product_options',
'title' => 'Product Options',
'fields' => array (
array (
'key' => 'acf_product_options_tabbedcontent_label',
'label' => 'Tabbed Content',
@jasperf
jasperf / footer.liquid
Created November 14, 2019 02:50
Shopify Footer loading Klaviyo newsletter when a menu block is added
@jasperf
jasperf / nginx.dockerfile
Last active September 26, 2018 01:47 — forked from qzm/nginx.dockerfile
Nginx 1.14.0 dockerfile --with-http_headers_module
FROM alpine:3.8
LABEL maintainer="NGINX Docker Maintainers <[email protected]>"
ENV NGINX_VERSION 1.14.0
RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
&& CONFIG="\
--prefix=/etc/nginx \
--sbin-path=/usr/sbin/nginx \
/**
* Class DownloadFile
*/
Class DownloadFile
{
public $url = 'http://example.com/image.jpg';
public $path = '/path/to/write';
private $filename;
private $file;
<template>
<div class="modal-root">
<!-- Modal -->
<div class="modal image-uploader" :class="modalId" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
@jasperf
jasperf / class-object-binding.vue
Created June 5, 2018 08:20
Vue Class Object Binding
<img
:class="{ unSplashThumbActive: isActive[photo.urls.small] }"
:src="photo.urls.small"
@click="mouseDownSelect(photo.urls.small)"
/>
@jasperf
jasperf / Dockerfile
Last active May 7, 2018 07:32
Dockerfile Nginx with SSL Setup using commercial certificates (Laradock based)
FROM nginx:alpine
LABEL maintainer="Mahmoud Zalt <[email protected]>"
COPY nginx.conf /etc/nginx/
# If you're in China, or you need to change sources, will be set CHANGE_SOURCE to true in .env.
ARG CHANGE_SOURCE=false
RUN if [ ${CHANGE_SOURCE} = true ]; then \
@jasperf
jasperf / jupiter-theme-logo-storage-form.html
Created February 25, 2018 05:43
Jupiter theme logo storage rights conflict
"<form action="" method="post">
<div id="request-filesystem-credentials-form" class="request-filesystem-credentials-form">
<h2 id='request-filesystem-credentials-title'>Connection Information</h2><p id="request-filesystem-credentials-desc">To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.</p>
<label for="hostname">
<span class="field-title">Hostname</span>
<input name="hostname" type="text" id="hostname" aria-describedby="request-filesystem-credentials-desc" class="code" placeholder="example: www.wordpress.org" value="" />
</label>
<div class="ftp-username">
<label for="username">
<span class="field-title">FTP Username</span>