Skip to content

Instantly share code, notes, and snippets.

View jin0x's full-sized avatar
:octocat:
Working from home

John Leskas jin0x

:octocat:
Working from home
  • RSH Creative Web Studio LTD
  • Limassol, Cyprus
  • X @john_leskas
View GitHub Profile
;(function () {
/**
* Run function when customizer is ready.
*/
wp.customize.bind('ready', function () {
wp.customize.control('slug_select_control', function (control) {
/**
* Run function on setting change of control.
*/
control.setting.bind(function (value) {
@cryptexvinci
cryptexvinci / woo_rename_checkout.php
Last active December 20, 2023 09:48
Rename WooCommerce checkout field label & placeholder
<?php
// WooCommerce Rename Checkout Fields
add_filter( 'woocommerce_checkout_fields' , 'custom_rename_wc_checkout_fields' );
// Change placeholder and label text
function custom_rename_wc_checkout_fields( $fields ) {
$fields['billing']['billing_first_name']['placeholder'] = 'Wonka';
$fields['billing']['billing_first_name']['label'] = 'Your Awesome First Name';
return $fields;
}
@theJasonJones
theJasonJones / README.md
Last active June 27, 2024 22:53
Auto Populate Wordpress ACF Repeater values

Add default values to ACF Repeater Fields

I came across this solution when I had about a ton of posts (200+) with values in various PDFs. I didn't want to have to spend time filling out the same values over and over again.

Walkthrough

This case is pretty straight forward; I have one repeater field field_123a56b7cb890 that has a text fields inside it (field_588a24c3cb782). I haven't tried any other types like post objects or radio buttons, but I'm sure it can be done.

Step 1. Hook into acf/load_value on your repeater field. You can use type/key/name as desired here.

@zachleat
zachleat / critical-foft-data-uri.html
Last active October 21, 2021 07:25
Compare Critical FOFT with Data URI against Critical FOFT
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Critical FOFT with Data URI</title>
<style>
@font-face {
font-family: LatoSubset;
src: url("data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAABVwAA0AAAAAG+QAARqgAAAAAAAAAAAAAAAAAAAAAAAAAABHREVGAAABMAAAABYAAAAWABEANkdQT1MAAAFIAAACkQAAA9wvekOPT1MvMgAAA9wAAABcAAAAYNjUqmVjbWFwAAAEOAAAADgAAABEAIcBBGdhc3AAAARwAAAACAAAAAgAAAAQZ2x5ZgAABHgAAA8EAAAUUN1x8mZoZWFkAAATfAAAADYAAAA2DA2UbWhoZWEAABO0AAAAHgAAACQPOga/aG10eAAAE9QAAADIAAAA2PXwFPVsb2NhAAAUnAAAAG4AAABuhQSA721heHAAABUMAAAAGgAAACAAOgBgbmFtZQAAFSgAAAA0AAAANAI2Codwb3N0AAAVXAAAABMAAAAg/3QAegABAAAADAAAAAAAAAACAAEAAQA1AAEAAHicTZO/SxthGMe/d4k2NFbSFE2Maaq2tJ4/qtE4dwnBoUgoHUq5pWBBaCv0h4OCS2MLGUuXIhlKhwxFMnVwcAvB4SiSQSRkOEK9xan/wdvPRYQSnrzv3fu8n8/7vO97siRd1z0tyS6WHj/V8OsXHzY1rCjvZYzCcevVy3ebioW9fkRl99sYUepn5vTZWtOhdW7v6MJas+aIDeujdW5d2GV7x/4VSUaKkSf8ipFN4rK/EdnjaQ9KDuKArimuId1QQjeV1C2NaFQppTWmjMaV1W1N6K7ua1qOZjSreeW1
@tjFogarty
tjFogarty / wiredep.js
Created August 8, 2015 10:52
Gulp + Wiredep + Timber + Twig
var gulp = require('gulp');
var config = require('../config');
var wiredep = require('wiredep').stream;
gulp.task('wiredep', function () {
gulp.src(config.wiredep_file)
.pipe(wiredep({
directory: 'assets/lib',
ignorePath: '..',
fileTypes: {
@chantastic
chantastic / on-jsx.markdown
Last active May 30, 2024 13:11
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't

@bekarice
bekarice / wc-sku-sorting.php
Last active April 8, 2024 17:56
Sort WooCommerce Products by SKU
<?php // ONLY COPY THIS LINE IF NEEDED!
/**
* Adds the ability to sort products in the shop based on the SKU
* Can be combined with tips here to display the SKU on the shop page: https://www.skyverge.com/blog/add-information-to-woocommerce-shop-page/
*
* @param array $args the sorting args
* @return array updated args
*/
function sv_add_sku_sorting( $args ) {
@spivurno
spivurno / gw-gravity-forms-form-export.json
Created January 30, 2015 14:35
Gravity Wiz // Gravity Forms // JSON vs XML Export Format
{
"0": {
"title": "A Simple Form",
"description": "How much simpler is the form export format in Gravity Forms 1.9?",
"labelPlacement": "top_label",
"descriptionPlacement": "below",
"button": {
"type": "text",
"text": "Submit",
"imageUrl": ""
@LeCoupa
LeCoupa / nodejs-cheatsheet.js
Last active June 30, 2024 04:14
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@hofmannsven
hofmannsven / README.md
Last active July 3, 2024 09:53
Git CLI Cheatsheet