Skip to content

Instantly share code, notes, and snippets.

@hartliddell
hartliddell / LESS-CSS-Theme-Example.markdown
Created September 9, 2013 18:58
A Pen by Hart Liddell.
@hartliddell
hartliddell / An-Anonymous-Pen.markdown
Created September 24, 2013 16:40
A Pen by Secret Sam.
$.fn.setAllToMaxHeight = function() {
var that = this;
$(this).css({'height': 'auto'});
setTimeout(function() {
return that.height(Math.max.apply(that, $.map(that, function(e) {
return $(e).height();
})));
}, 500);
};
// Initiate scrolling social menu on single blog posts
function initSocialScroll() {
if($('article').hasClass('single-blog')) {
setTimeout(function() {
var $hornav = $('#horizontal_nav');
var $socialWrap = $('.social-like-wrapper');
var $_article = $('.single-blog .entry-content');
var articleTop = $_article.offset().top;
var articleHeight = $_article.height();
@hartliddell
hartliddell / migrate.php
Created February 9, 2015 23:28
Wordpress Migrate Script
<?php
/**
* Function migrateV2 updates Database tables values: site_ul, home, domain, post url
*
* @param string $urlToReplace migrate from http://xsite.com to htttp://ysite.com
*/
function migrateV2($urlToReplace){
global $table_prefix;
$error = false;
/*
* Data from WeatherUnderground for
* forecast_for("NY","New York")
*/
{
"response" => {
"version" => "0.1",
"termsofService" => "http://www.wunderground.com/weather/api/d/terms.html",
"features" => {
"forecast" => 1
console.log("Puppies!");
@hartliddell
hartliddell / Google-Sheet-Form-Post.md
Created October 14, 2015 18:03 — forked from willpatera/Google-Sheet-Form-Post.md
Post to google spreadsheet from html form

Overview

This collection of files serves as a simple static demonstration of how to post to a google spreadsheet from an external html <form> following the example by Martin Hawksey

Run example

You should be able to just open index.html in your browser and test locally.

However if there are some permissions errors you can make a quick html server with python. Open terminal and cd to the directory where the gist files are located and enter python -m SimpleHTTPServer. By default this creates a local server at localhost:8000

@hartliddell
hartliddell / InfiniteScroll-ES6.js
Created May 7, 2016 20:52 — forked from ChrisLTD/InfiniteScroll-ES6.js
Infinite "Scroll" javascript module for ES6
'use strict';
// Infinite scrolling loader, fires off a button click
//
// Sample HTML:
// <div id="infinite-scroll" class="js-infinite-scroll">
// POSTS HERE
// <a href="/url-to-more-content" class="js-infinite-scroll-next-button">Load More</a>
// </div>
// <div class="js-infinite-scroll-loading">...</div>