Skip to content

Instantly share code, notes, and snippets.

View neilbannet's full-sized avatar
🌴
On vacation

Zain Neil B Ul Abadin neilbannet

🌴
On vacation
View GitHub Profile
@webaware
webaware / woocommerce-notices-shortcode.php
Last active March 17, 2022 17:45
display WooCommerce notices in any page by shortcode [woocommerce_notices]
<?php
/*
Plugin Name: WooCommerce Notices Shortcode
Plugin URI: https://gist.github.com/webaware/c6a6286026eb6a89e5a3
Description: display WooCommerce notices in any page by shortcode [woocommerce_notices]
Author: WebAware
Author URI: https://shop.webaware.com.au/
*/
if (!defined('ABSPATH')) {
@carlitoescobar
carlitoescobar / gravityforms-checkbox-checkall.js
Created February 7, 2015 00:00
Gravity Forms check all function (jQuery)
// Needed this for a client project, thanks! I improved upon it to make it more generic so you don't have to look up individual IDs on elements:
jQuery(document).ready(function(){
// Check all in Gravity Forms
jQuery('.checkall li:first-child input').click(function() {
jQuery(this).parent('li').parent('ul').find(':checkbox').attr('checked', this.checked);
});
});
// Just add a class "checkall" to your checkbox form item in Gravity Forms, it assumes the first item in the list will be the "All" option.
@juanbzpy
juanbzpy / social-options-wp.md
Last active October 15, 2017 15:04
How to add social icons using Option Tree and Font Awesome in WordPress

in header.php

<?php
  if ( function_exists( 'ot_get_option' ) ) {
    $social_media_channels = array(
      "Facebook" => "fa fa-facebook-square",
      "Twitter" => "fa fa-twitter-square",
      "Google+" => "fa fa-google-plus-square",
 "Linkedin" =&gt; "fa fa-linkedin-square",
@flangofas
flangofas / ConvertMS.js
Last active February 29, 2024 17:22
JS: Convert Milliseconds to days? minutes? seconds? or all!
function convertMiliseconds(miliseconds, format) {
var days, hours, minutes, seconds, total_hours, total_minutes, total_seconds;
total_seconds = parseInt(Math.floor(miliseconds / 1000));
total_minutes = parseInt(Math.floor(total_seconds / 60));
total_hours = parseInt(Math.floor(total_minutes / 60));
days = parseInt(Math.floor(total_hours / 24));
seconds = parseInt(total_seconds % 60);
minutes = parseInt(total_minutes % 60);
@keccers
keccers / map-test.html
Last active December 25, 2023 19:15
Google Maps Custom Zoom Controls
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Custom Controls Test</title>
@clarklab
clarklab / wp_insert_post_front_end_form.php
Created May 25, 2012 00:12
This is a sample front-end form using wp_insert_post(). It's quickly stripped out of my production code from Android and Me, and hasn't been tested alone, so please take it with a grain of salt.
<?
if( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['insert_post'] )) { //check that our form was submitted
$title = $_POST['thread_title']; //set our title
if ($_POST['thread_description']=="") { // check if a description was entered
$description = "See thread title..."; // if not, use placeholder
} else {
$description = $_POST['thread_description']; //if so, use it
@og-shawn-crigger
og-shawn-crigger / maxsize.php
Created April 9, 2012 13:59
Get Max Upload Size from PHP ini's 'post_max_size' && 'upload_max_filesize'
<?php
//Simple Function to Get Max Upload Size from PHP
$max_upload = min(ini_get('post_max_size'), ini_get('upload_max_filesize'));
$max_upload = str_replace('M', '', $max_upload);
$max_upload = $max_upload * 1024;
@psychemedia
psychemedia / googDynChartControl.html
Created June 6, 2011 13:56
Google Dynamic Chart control, feeding off Google Spreadsheet/visualisation API query
<html><head>
<title>Google visualisation demo: chart query controls</title>
<!--Load the AJAX API-->
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
// Load the Visualization API and the controls package.
// Packages for all the other charts you need will be loaded
// automatically by the system.