Skip to content

Instantly share code, notes, and snippets.

View V0IDNIL's full-sized avatar

VOIDNIL V0IDNIL

  • Osaka
  • 09:31 (UTC +09:00)
View GitHub Profile
<?php
/**
* A Hack to generate mock WP Post objects from any arbitrary array
* A possible use case is to render a list of taxonomy terms using Oxygen Builder's repeater element,
* as the repeater allows only WP_Query as a source of data
*
* @author: Gagan S Goraya
* @link: https://gagangoraya.com
*
@wplit
wplit / code-block.js
Last active May 21, 2022 10:14
trigger offcanvas opening when item added to cart (add to code block and just change the class or ID to match your offcanvas)
(function($){
let offCanvas = '.my-offcanvas'; // Change to your offcanvas selector (class or ID)
/* When item is added to cart */
$( document.body ).on( 'added_to_cart', function(){
/* Toggle the classes to open the offcanvas */
$('html,body').addClass('off-canvas-toggled');
$(offCanvas).addClass('oxy-off-canvas-toggled');
@yankiara
yankiara / oxygen-repeater-dynamic-query.php
Last active July 15, 2024 15:17
Use dynamic queries with Oxygen's repeater
/* I'll put here different examples of dynamic query for Oxygen repeater :
* - Use one of the following repeater_dynamic_query definitions
* in code block just BEFORE the repeater
* - Set the repeater custom query settings : post type, number of posts, order...
* - Add the remove_action in a code block AFTER the repeater
*/
/****************************************************************************************************
* Display related posts for any CPT with taxonomy:
@andrewdelprete
andrewdelprete / webpack.config.js
Last active April 12, 2023 01:55
Webpack: Tailwind CSS + PurgeCSS Example
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const path = require("path");
const glob = require("glob-all");
const PurgecssPlugin = require("purgecss-webpack-plugin");
/**
* Custom PurgeCSS Extractor
* https://github.com/FullHuman/purgecss
* https://github.com/FullHuman/purgecss-webpack-plugin
*/
@lonchbox
lonchbox / gist:fb152c46f4ed5c1a410f
Created March 10, 2016 16:25
Display Custom Taxonomy image field with Pods.io
<?php
$terms = get_terms( 'TAXONOMY' );
if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){
foreach ( $terms as $term ) {
echo '<div class="item">';
$icon = pods_field( 'TAXONOMY', $term->term_id, 'FIELD', true );
$icon_url = $icon['guid'];
$icon_thumb = pods_image_url ( $icon_url, 'thumbnail', 0, false ) ;
$term_link = get_term_link($term);
echo '<a href="'.$term_link.'">';
@natelandau
natelandau / .bash_profile
Last active July 27, 2024 05:39
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@Shelob9
Shelob9 / 1-pods-loop-general-example.php
Last active April 14, 2023 12:23
Pods Looping Examples.
<?php
//set up pods::find parameters to limit to 5 items
$param = array(
'limit' => 5,
);
//create pods object
$pods = pods('pod_name', $params );
//check that total values (given limit) returned is greater than zero
if ( $pods->total() > 0 ) {
@matchy256
matchy256 / rec_radiko.sh
Last active October 31, 2023 08:23 — forked from saiten/rec_radiko.sh
簡易Radiko録音スクリプト
#!/bin/bash
LANG=ja_JP.utf8
pid=$$
date=`date '+%Y-%m-%d-%H_%M'`
outdir="."
if [ $# -le 1 ]; then
@christianhanvey
christianhanvey / modx-snippets.php
Last active June 14, 2023 13:02
Useful snippets for MODX Revo
Snippet: [[SnippetName]]
Chunk: [[$ChunkName]]
System Setting: [[++SettingName]]
TV: [[*fieldName/TvName]]
Link tag: [[~PageId? &paramName=`value`]]
Placeholder: [[+PlaceholderName]]
<?php
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/