Skip to content

Instantly share code, notes, and snippets.

View E-VANCE's full-sized avatar
🌳
Huggin'

Henning Orth E-VANCE

🌳
Huggin'
View GitHub Profile
@glueckpress
glueckpress / wgm-is-2nd-checkout.php
Last active January 11, 2016 18:36
[WordPress] Conditional tag for WooCommerce German Market 2.x determining whether the current page is the second checkout page.
<?php
/**
* Plugin: WooCommerce German Market 2.x
* Conditional check whether current page is second checkout
*/
if ( ! function_exists( 'wgm_is_2nd_checkout' ) && ! is_admin() ) :
/**
* Check if page is WGM 2nd checkout
*
* @return bool
@mvark
mvark / TransformJSONFieldNamesForFullCalendar.js
Last active June 5, 2018 21:30
Transform JSON field names in feed to match FullCalendar jQuery plugin's Event format
$(document).ready(function() {
$('#calendar').fullCalendar({
defaultDate: '2014-11-13',
editable: true,
eventLimit: true, // allow "more" link when too many events
events: function (start, end, timezone, callback) {
$.ajax({
url: "http://example.azure-mobile.net/tables/event?$filter=eventdate gt '" + start.toISOString() + "' and eventdate lt '" + end.toISOString() + "'",
dataType: 'json',
beforeSend: setHeader,
@jarbro
jarbro / filemaker-openfire-api-integration.md
Last active September 12, 2018 03:34
FileMaker Openfire REST API Integration

FileMaker Openfire API Integration

We've been using Openfire XMPP at my company since ~2004 and wanted to be able to push out some alerts to our users from FileMaker using our existing chat client. In this example we are just going to send a system broadcast message to all users. For other uses you can find the Full REST API documentation here.

What you will need.

  • Latest Version of Openfire XMPP server Link
  • FileMaker Pro or Server
  • Base Elements Plugin download or FileMaker Pro 16.
  • Time, Love & Tenderness
@mikejolley
mikejolley / ipn-test.php
Last active September 18, 2020 14:29
Quick snippet/plugin/dropin to test IPN support
<?php
/**
* Plugin Name: PayPal Sandbox IPN Tester
* Description: Pings the IPN endpoint to see if your server can connect. Just head to <a href="/?ipn-test=1">yoursite.com/?ipn-test=1</a> whilst logged in as admin.
* Version: 1.0.0
* Author: WooThemes
* Requires at least: 4.1
* Tested up to: 4.3
*/
if ( ! defined( 'ABSPATH' ) ) {
@retlehs
retlehs / header.php
Created April 29, 2015 04:55
Sage header template for Bootstrap top navbar component
<?php
// This file assumes that you have included the nav walker from https://github.com/twittem/wp-bootstrap-navwalker
// somewhere in your theme.
?>
<header class="banner navbar navbar-default navbar-static-top" role="banner">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only"><?= __('Toggle navigation', 'sage'); ?></span>
@kjbrum
kjbrum / search_for_value.php
Last active March 20, 2021 06:24
Check if a value exists in an array/object.
<?php
/**
* Check if an array is a multidimensional array.
*
* @param array $arr The array to check
* @return boolean Whether the the array is a multidimensional array or not
*/
function is_multi_array( $x ) {
if( count( array_filter( $x,'is_array' ) ) > 0 ) return true;
return false;
@esfand
esfand / nginxvarcore.md
Last active May 17, 2021 16:39
Nginx Variables

Embedded Variables

The ngx_http_core_module module supports embedded variables with names matching the Apache Server variables. First of all, these are variables representing client request header fields, such as $http_user_agent, $http_cookie, and so on. Also there are other variables:

  • $arg_name
    argument name in the request line
@soderlind
soderlind / insert-link-to-pdf.php
Last active October 21, 2021 23:17
WordPress: In the editor, using "Insert Link", insert link to a PDF file in the media library
@kharissulistiyo
kharissulistiyo / functions.php
Last active May 2, 2022 16:25
Extending WooCommerce Product Shortcode
<?php
/**
* Extending query parameter of product shortcode
*/
add_filter('woocommerce_shortcode_products_query', 'my_wc_shortcode_product_query_args', 10, 2);
function my_wc_shortcode_product_query_args($args, $atts){
if ( isset( $atts['item'] ) ) {
@klihelp
klihelp / wc-pagination-functions.php
Last active June 6, 2022 03:37
WooCommerce shortcode pagination on pages
<?php
/**
* Thanks for James Kemp / Iconic turning the idea into a plugin
* https://wordpress.org/plugins/shortcode-pagination-for-woocommerce
*
* This code shows pagination for WooCommerce shortcodes when it's embeded on single pages.
* Include into functions.php.
*/
if ( ! is_admin() ) {