Skip to content

Instantly share code, notes, and snippets.

@mikejolley
mikejolley / ipn-test.php
Last active September 5, 2024 01:54
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' ) ) {
@ahmedelgabri
ahmedelgabri / _README.md
Last active February 17, 2017 07:49
Node script to export all your delicious bookmarks
  1. Download or clone the gist.
  2. cd into the directory & do $ npm install
  3. I have used nodedelicious and it needs you to store delcious username & password as enviromnet varaibles so you will need to do the following.
$ export DELICIOUS_USER="<your username>" && export DELICIOUS_PASSWORD="<your password>"
  1. Run $ node index.js
  2. PROFIT! you have your delicious export in a file called bookmarks.html that you can save or import in Pocket.
@mattradford
mattradford / acf_get_directions.php
Last active July 24, 2024 18:08
ACF Get Directions map link
<?php
$location = get_field('map_location');
if ( !empty( $location ) ) :
$map_url = 'https://www.google.com/maps/dir/?api=1&destination=' . $location['lat'] . ',' . $location['lng'];
echo '<a href=". esc_url( $map_url ) . '" rel="nooopener">Get directions</a>';
endif;
?>
<p>This should produce a link like this:</p>
<a href="https://www.google.com/maps/dir/?api=1&destination=51.072159,1.088130">Get directions</a>
@gregrickaby
gregrickaby / infinite-scroll-masonry-imagesloaded.php
Last active June 14, 2023 13:01
Infinite Scroll + Masonry + ImagesLoaded
/**
* Be sure to include library scripts in this order. Can be placed either
* in the header or footer.
*/
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-infinitescroll/2.0b2.120519/jquery.infinitescroll.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/masonry/3.1.2/masonry.pkgd.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery.imagesloaded/3.0.4/jquery.imagesloaded.min.js"></script>
@charleslouis
charleslouis / custom-search-acf-wordpress.php
Last active December 15, 2023 09:11
PHP - Wordpress - Search - wordpress custom search function that encompasses ACF/advanced custom fields and taxonomies and split expression before request
<?php
/**
* [list_searcheable_acf list all the custom fields we want to include in our search query]
* @return [array] [list of custom fields]
*/
function list_searcheable_acf(){
$list_searcheable_acf = array("title", "sub_title", "excerpt_short", "excerpt_long", "xyz", "myACF");
return $list_searcheable_acf;
}
@aquarius
aquarius / gist:5823110
Last active April 5, 2019 13:10
MindNode URL Schemes

#MindNode URL Schemes

Basic

###Launch MindNode mindnode://

####Examples mindnode://

###Open Document

@sturobson
sturobson / user preferences
Last active March 31, 2021 11:36
My current sublime text 2 user preferences
{
"auto_complete": true,
"auto_complete_commit_on_tab": true,
"auto_indent": true,
"auto_match_enabled": true,
"bold_folder_labels": true,
"caret_style": "wide",
"color_scheme": "Packages/Color Scheme - Default/Blackboard.tmTheme",
"detect_slow_plugins": false,
"draw_minimap_border": true,
@patrickwelker
patrickwelker / Simple share buttons
Created January 23, 2013 17:36
Simple social share buttons for WordPress. It's worth a mention that if you use certain themes, they might use a special `%permalink%` and `%post-title%` structure. Be sure to replace the default `<?php the_title(); ?>` and `<?php the_permalink(); ?>` with it. #Facebook #Twitter #Google+
<a title="Share" href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&t=<?php the_title(); ?>">Share on Facebook</a>
<a title="Tweet" href="https://twitter.com/share?url=&text=<?php the_title(); ?>: <?php echo urlencode(get_permalink($post->ID)); ?> &via=YOUR-TWITTER-USERNAME&count=horizontal">Tweet This</a>
<a title="PlusOne" href="https://plusone.google.com/_/+1/confirm?hl=en&url=<?php the_permalink(); ?>">+1</a>
@murtaugh
murtaugh / 1. single-line.html
Last active April 21, 2021 16:23
Blockquote patterns for ALA
<figure class="quote">
<blockquote>It is the unofficial force—the Baker Street irregulars.</blockquote>
</figure>
@ttscoff
ttscoff / octopress.js
Created October 19, 2012 01:53
Quick function to check viewport size and chop/crop images (CSS3) for mobile views.
var bt = {}; // to call the functions outside of the jQuery wrapper because OctoPress is a bit of a JS mess. Hey, that rhymes.
(function($){
bt = {
checkWinWidth: function() {
var width = $(window).width();
if (width <= 500) {
if (!$('body').hasClass('mobile')) {
$('img').each(function(){
var $this = $(this);