Skip to content

Instantly share code, notes, and snippets.

Avatar

Thomas Bennett thomasbennett

View GitHub Profile
View class-gf-webhooks.php
<?php
// put the code from this section into the if/else below around line 615
// if ( in_array( $request_method, array( 'GET', 'DELETE' ) ) && ! empty( $request_data ) ) {
// this garbage code will make their API work
if ( $request_method === 'GET' && 'json' === $feed['meta']['requestFormat'] ) {
// Add content type header.
$request_headers['Content-Type'] = 'application/json';
@thomasbennett
thomasbennett / show-hide.html
Last active Oct 24, 2017
Show / Hide an element with Bootstrap
View show-hide.html
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('#button-id-here').on('click', function() {
jQuery('#form-id-here').toggleClass('hidden');
});
});
</script>
<button id="button-id-here">Click Me</button>
View gist:5333083
<div itemscope itemtype="http://schema.org/Product">
<a href="http://lbemuoil.com/ultra-emu-oil.html" title="{name}">
<img src="{img}.jpg" alt="{name}" title="{name}">
</a>
<span itemprop="name">{name}</span>
<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
Rated <span itemprop="ratingValue">{rating}</span>/{totalStars} based on <span itemprop="reviewCount">{totalReviews}</span> customer reviews
</div>
Product description:
View gist:5333052
<a href="http://lbemuoil.com/ultra-emu-oil.html" title="Ultra Emu Oil">
<img src="http://lbemuoil.com/media/catalog/product/cache/1/small_image/170x170/9df78eab33525d08d6e5fb8d27136e95/2/o/2oz-ultra-01.jpg" alt="Ultra Emu Oil" title="Ultra Emu Oil">
</a>
View gist:5217247
<label>Store Description</label>
<span class="edit">
<textarea id="js-store-name" class="count-check"></textarea>
<span class="icon">d</span>
</span>
<span class="count-help">
<span class="count-limit">200</span> characters remaining
</span>
View gist:5216645
<div class="eight columns">
<label>Store Name</label>
<a class="edit edited"><input type="text" value="Kate's Flowers"><span class="icon">d</span></a>
<label>Store Name</label>
<a class="edit">
<textarea id="js-store-name" class="count-check"></textarea>
<span class="icon">d</span>
</a>
<span class="count-help">
View gist:5216570
var editInPlace = $('a.edit');
editInPlace.on('focus', 'input, textarea', function(){
t.parents('a.edit').toggleClass('edited');
}).on('blur', 'input, textarea', function() {
var t = $(this);
if ( t.val() != '' || t.text() != '' ) {
t.parents('a.edit').addClass('edited');
} else {
You can’t perform that action at this time.