Skip to content

Instantly share code, notes, and snippets.

View codfish's full-sized avatar

Chris O'Donnell codfish

View GitHub Profile
@CMCDragonkai
CMCDragonkai / UrlFriendly.Filter.js
Created August 21, 2013 06:36
JS: Angular Url Friendly Filter. Can be used to create url friendly permalinks from blog titles. Port of url_title in Codeigniter.
define(['angular'], function(angular){
'use strict';
angular.module('Filters')
.filter('UrlFriendly', [
function(){
return function(text, separator, lowercase){
var output,
@ijones922
ijones922 / gist:5952576
Created July 8, 2013 21:17
Javascript: equal column heights
function matching_heights() {
var highestCol = Math.max($('').height(),$('').height());
$('').height(highestCol);
}
@rpavlovic
rpavlovic / wp_average_comments.sql
Created January 29, 2015 14:43
Wordpress SQL: average comments per day over time
SELECT
'2010-11-24' AS date_begin,
'2015-01-26' AS date_end,
day_of_week,
AVG(comment_count) AS average_comments
FROM (
SELECT
comment_date,
DAYNAME(comment_date) day_of_week,
DAYOFWEEK(comment_date) day_num,
@ozh
ozh / gist:0cd11817a4767d87bb72
Created January 19, 2015 11:42
Manual CRON in WP

wp-config.php:

define( 'DISABLE_WP_CRON', true );

Cronjob: one of:

*/15 * * * * wget -q -O - http://www.website.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1
*/15 * * * * curl http://www.website.com/wp-cron.php?doing_wp_cron > /dev/null 2>&1
*/15 * * * * cd /home/user/public_html; php wp-cron.php > /dev/null 2>&1