Skip to content

Instantly share code, notes, and snippets.

View hchouhan's full-sized avatar
💡
Thinking

Harish Chouhan hchouhan

💡
Thinking
View GitHub Profile
@corradomatt
corradomatt / gravityforms-bs-datepicker.less
Last active November 28, 2023 20:34
Addon for using gravity forms with a bootstrap based development such as the roots.io theme for WordPress. I specifically wrote this for a roots theme and it's based on this post http://roots.io/style-gravity-forms-with-bootstrap/ by Ben Word.This goes one step further and provides support for some native gravity forms style declarations for for…
/**
* Borrowed from https://github.com/addyosmani/jquery-ui-bootstrap
* Styles the datepicker popup for gravityforms used with bootstrap
*/
/*
* jQuery UI Datepicker
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
@corsonr
corsonr / gist:6681929
Last active March 2, 2021 18:14
WooCommerce - Create a product categories dropdown list in a shortcode
<?php
/**
* WooCommerce Extra Feature
* --------------------------
*
* Register a shortcode that creates a product categories dropdown list
*
* Use: [product_categories_dropdown orderby="title" count="0" hierarchical="0"]
*
@stowball
stowball / rwd-resources.md
Last active October 27, 2018 19:33
Articles and resources on responsive design approaches and workflows
@grappler
grappler / adaptive-shortcode.php
Last active December 21, 2015 16:49
This short plugin allows users to display content according to the device the page is being viewed on.
<?php
/**
*
* @package Adaptive Shortcode
* @author Ulrich Pogson <grapplerulrich@gmail.com>
* @license GPL-2.0+
* @link http://ulrich.pogson.ch
* @copyright 2013 Ulrich Pogson
*
* @wordpress-plugin
@mclanecreative
mclanecreative / espn-inspired-prompt-css
Last active December 14, 2015 19:59
/// WordPress hack /// Fashioned after ESPN Insider, this function is intended to prompt non-members to join a WordPress site. This code will be created in a way which the administrator can copy/paste the snippet into function.php, customize the graphic/URLs, and style via CSS. For this usage, we'll hide/show content with S2member pro. But any m…
/* = Stuff added for the login/logout
-------------------------------------------------------------- */
.well-join {
display: block;
background-image: url(http://uywi.org/wp-content/uploads/2013/03/theWell_JoinBoxR02.jpg);
background-repeat:no-repeat;
height:300px;
width:760px;
text-indent:-9999px;
padding-top:.7em;
@jfloff
jfloff / mamp.md
Last active October 31, 2025 18:50
How to get MAMP to work with SSL ... Yes really.

First of all you need to be able to run MAMP in port 80. This is a "heat check" if you don't have any process jamming http ports. You can check it like this:

sudo lsof | grep LISTEN

If you do happen to have any process with something like this *:http (LISTEN), you are in trouble. Before with adventure check if it isn't MAMP itself (yeah, you should close that beforehand)

ps <pid of that process>

If you don't see MAMP, you are in good hands, I have just the thing for you:

@jameskoster
jameskoster / functions.php
Last active October 5, 2020 17:34
WooCommerce - Remove product data tabs
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );
function woo_remove_product_tabs( $tabs ) {
unset( $tabs['description'] ); // Remove the description tab
unset( $tabs['reviews'] ); // Remove the reviews tab
unset( $tabs['additional_information'] ); // Remove the additional information tab
return $tabs;
@Pushplaybang
Pushplaybang / post_format_embed.php
Last active December 11, 2015 09:08
starting point for dealing with embeds from the _format_video_embed meta feild
<?php
// Display Videos
// Utility function - allow us to strpos an array
if ( ! function_exists( 'video_strpos_arr' )) {
function video_strpos_arr($haystack, $needle) {
if( !is_array($needle) ) $needle = array($needle);
foreach( $needle as $what ) {
@joshearl
joshearl / PowerShell.sublime-build
Created January 12, 2013 14:23
Custom Sublime Text build system that executes the build.ps1 script. To use, save PowerShell.sublime.build in /Data/Packages/User and put build.ps1 in the same directory as the current Sublime project file.
{
"cmd": ["%SystemRoot%\\system32\\WindowsPowerShell\\v1.0\\powershell.exe", "./build.ps1"],
"shell": true,
"working_dir": "${project_path}"
}
@Geczy
Geczy / sso_login_freshdesk.php
Created December 4, 2012 22:16
SSO Login for Freshdesk support portal - PHP Sample Code
function freshdesk_login_url($name, $email) {
$secret = '____Place your Single Sign On Shared Secret here_____';
$base = 'http://mycompany.freshdesk.me/';
return $base . "login/sso/?name=" . urlencode($name) . "&email=" . urlencode($email) . "&hash=" . hash('md5', $name . $email . $secret);
}
header("Location: " . freshdesk_login_url("John Doe", "username@thecompany.com") );