Skip to content

Instantly share code, notes, and snippets.

View jon-heller's full-sized avatar

Jon Heller jon-heller

View GitHub Profile
@marushu
marushu / set-filter-by-tax.php
Last active November 21, 2023 05:23
Supports multiple filters.
<?php
function multiple_filter_at_cpt() {
global $typenow;
$args = array(
'public' => true,
'_builtin' => true,
);
$custom_post_types = get_post_types( $args );
$custom_post_types = array_values( $custom_post_types );
@keon
keon / pagination.js
Last active March 24, 2021 06:16
javascript pagination algorithm
var pagenation = function(current, total){
var list = [];
var pageLimit = 5;
var upperLimit, lowerLimit;
var currentPage = lowerLimit = upperLimit = Math.min(current, total);
for (var b = 1; b < pageLimit && b < total;) {
if (lowerLimit > 1 ) {
lowerLimit--; b++;
}
@maxkandler
maxkandler / gist:5233150
Created March 24, 2013 19:25
Hide the iTerm2 Dock icon.
/usr/libexec/PlistBuddy -c 'Add :LSUIElement bool true' /Applications/iTerm.app/Contents/Info.plist
@oodavid
oodavid / README.md
Created March 26, 2012 17:05
Backup MySQL to Amazon S3

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc