Skip to content

Instantly share code, notes, and snippets.

View jkereako's full-sized avatar

Jeff Kereakoglow jkereako

View GitHub Profile
@jkereako
jkereako / wpcom-sitemap.php
Last active December 20, 2015 03:29 — forked from mjangda/wpcom-sitemap.php
Fixes a few bugs.
<?php
/**
* Generate sitemap files in base XML as well as popular namespace extensions
*
* @author Automattic
* @version 2.0
* @link http://sitemaps.org/protocol.php Base sitemaps protocol
* @link http://www.google.com/support/webmasters/bin/answer.py?answer=74288 Google news sitemaps
*/
@jkereako
jkereako / wpcom-sitemap-categories.php
Last active February 22, 2018 01:56
Add your categories to WordPress.com's sitemap.xml.
<?php
/**
* Adds categories to the sitemap by filtering wpcom_print_sitemap.
*
* @uses array_key_exists, esc_url, function_exists, get_categories, is_array, taxonomy_image_plugin_get_associations, taxonomy_image_plugin_get_image_src, trailingslashit, wpcom_sitemap_array_to_simplexml
* @return array
*/
function nesn_filter_wpcom_print_sitemap( $tree, $latest_mod ) {
$url_base = trailingslashit( get_bloginfo( 'siteurl' ) );
$categories = array();
@jkereako
jkereako / load-external-script.php
Created July 25, 2013 17:14
This function uses jQuery getScript() to load external JavaScript files, which are printed at the footer of the HTML source. You use it by filtering nesn_load_external_script().
/**
* Hookable filter which loads external scripts in the footer. See the example below
*
* <code>
* filter_nesn_load_external_script( $params ) {
* $params['unique_id']['url'] = 'http://path.to/resource.js';
* $params['unique_id']['callback'] = 'callMeAfterScriptLoads';
* return $params;
* }
*
@jkereako
jkereako / class-nesn-programming.php
Created August 2, 2013 17:04
Handles the TV Tune-In and the TV Schedule.
<?php
/**
* NESN PROGRAMMING
*
* Handles the TV Tune-In and the TV Schedule
*/
class NESN_Programming {
/**
* Class variables
@jkereako
jkereako / tb_remove_cb.js
Created April 23, 2014 21:52
Provides a callback parameter to the Thickbox function tb_remove(). The callback will be executed after Thickbox has left the screen.
// Define this at the beginning of your JavaScript file.
// Use thusly: tb_remove( function(){ console.log( "Thickbox has left the building" )} );
var tb_removeOriginal = window.tb_remove;
window.tb_remove = function( callback ) {
tb_removeOriginal();
var obj = {};
// Check that "callback" is actually a function.
@jkereako
jkereako / gpt-background.js
Last active December 21, 2017 13:02
A Doubleclick for Publishers creative template which changes the background image and color of the <body> and allows for the background to be a clickable link. Only compatiable with non-responsive, desktop layouts that have a center column width of 970 pixels.
/**
* Ensures that the object window has not been reassigned a new value.
* @param Object window
*/
(function(window) {
/**
* An array of valid CSS rules. This is the only part of the code that
* ought to be edited.
*
@jkereako
jkereako / ADModalSegue.h
Last active August 29, 2015 14:13
Don't see a navigation bar on a modally presented view controller? Here's the solution: subclass UIStoryboardSegue, override perform: and in its definition create an ad-hoc navigation controller. Then, use this custom segue in the Storyboard builder.
//
// ADModalSegue.h
//
// Created by Jeffrey Kereakoglow on 11/28/14.
// Copyright (c) 2014 Alexis Digital. All rights reserved.
//
@import UIKit;
@interface ADModalSegue : UIStoryboardSegue
@jkereako
jkereako / symmetric-difference.m
Last active March 24, 2021 02:27
Finds the symmetric difference between 2 sets.
//
// symmetric-difference.m
// RosettaCodeData
//
// Created by Ingy döt Net on 4/2/14.
// https://github.com/acmeism/RosettaCodeData/blob/master/Task/Symmetric-difference/Objective-C/symmetric-difference.m
//
#import <Foundation/Foundation.h>
@jkereako
jkereako / regex-tester.m
Last active August 29, 2015 14:14
Use this code snippet to test your regular expression syntax.
//
// regex-tester.m
// Alexis Digital
//
// Created by Jeff Kereakoglow on 1/23/15.
//
// Use this code snippet to test your regular expression syntax.
//
#import <Foundation/Foundation.h>
@jkereako
jkereako / ADAuthenticationModel.h
Last active August 29, 2015 14:14
Classes for handling HTTP requests and credential storage.
//
// ADAuthenticationModel.h
// NetworkAuthentication
//
// Created by Jeffrey Kereakoglow on 3/11/15.
// Copyright (c) 2015 Alexis Digital. All rights reserved.
//
@import Foundation;