Skip to content

Instantly share code, notes, and snippets.

@wgbartley
wgbartley / proxy.php
Last active December 18, 2017 16:30
Spark PHP Proxy
<?php
// Set your access token here
define('ACCESS_TOKEN', 'your_access_token_here');
// Make sure we have an HTTP_ACCEPT header,
// and if so, make it lower-case for easier string matching
if(isset($_SERVER['HTTP_ACCEPT']))
$_SERVER['HTTP_ACCEPT'] = strtolower($_SERVER['HTTP_ACCEPT']);
else
@Shelob9
Shelob9 / pods_metabox_title.php
Created April 10, 2014 19:31
Change the heading of the Pods "More Fields" metabox in the post editor.
<?php
add_filter( 'pods_meta_default_box_title', 'slug_pods_metabox_title' );
slug_pods_metabox_title( $title ) {
$title = __( 'Return of The Jedi', 'pods' );
return $title;
}
@netpoetica
netpoetica / Setting up Nginx on Your Local System.md
Last active November 13, 2024 17:24
Setting up Nginx on Your Local System

#Setting up Nginx on Your Local System ###by Keith Rosenberg

##Step 1 - Homebrew The first thing to do, if you're on a Mac, is to install homebrew from http://mxcl.github.io/homebrew/

The command to type into terminal to install homebrew is:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@thefuxia
thefuxia / t5-unique-login-field.php
Last active September 5, 2024 01:39
T5 Unique Log-in Field
<?php # -*- coding: utf-8 -*-
namespace Unique_Login;
/**
* Plugin Name: T5 Unique Log-in Field
* Description: Adds a checkbox with a unique name to the login form to prevent scripted log-in attempts.
* Plugin URI:
* Version: 2013.06.14
* Author: Thomas Scholz
* Author URI: http://toscho.de
* Licence: MIT
@sansolovyov
sansolovyov / anchorify.js
Last active February 12, 2020 09:27
Anchorify.js
/*
* Anchorify without jQuery
* Rewritten from https://github.com/willdurand/anchorify.js/
*/
var anchorify = (function() {
var specialCharsRe = /[ ;,.'?!_]/g;
function generateId(text) {
return text
@beausmith
beausmith / isotope-centered-masonry-and-masonry-gutters.js
Last active November 6, 2019 04:24 — forked from mattstauffer/gist:3835881
Isotope with Centered Masonry and Masonry Gutters.
$(function() {
// Tweaked from: https://gist.github.com/mattstauffer/3835881
// No guarantees
// 1. include Isotope.js
// 2. include this file
// 3. customize Isotope options at the bottom of this file
// 4. add "margin: 0 auto" to the isotope container
$.Isotope.prototype._getMasonryGutterColumns = function() {
@billerickson
billerickson / genesis-custom-loop-pagination.php
Created July 31, 2012 15:59
Genesis custom loop with pagination
<?php
/* Template Name: Test */
/**
* Genesis custom loop
*/
function be_custom_loop() {
global $post;
// arguments, adjust as needed
@helgatheviking
helgatheviking / custom-post-type-archive-menu-links.php
Created May 4, 2012 17:41
Adds Custom Post Type archives to the WordPress-powered menus
<?php
/*
Plugin Name: Custom Post Type Archive Menu Links
Plugin URI: http://codeseekah.com/2012/03/01/custom-post-type-archives-in-wordpress-menus-2/
Description: Easily Add Custom Post Type Archives to the Nav Menus
Version: 1.0
Author: soulseekah
Author URI: http://codeseekah.com
License: GPL2
@pamelafox
pamelafox / tumlbr_template.html
Created April 12, 2012 19:07
Twitter Bootstrap Tumblr Theme
<!doctype html>
<!--[if lt IE 7 ]> <html class="no-js ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]> <html class="no-js ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]> <html class="no-js ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--> <html class="no-js" lang="en" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://ogp.me/ns#"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name='description' content='{MetaDescription}'>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@jmdodd
jmdodd / gist:1497987
Created December 19, 2011 17:02
Filter FeedWordPress syndicated posts into custom post types
<?php
if ( ! function_exists( 'ucc_cpt_feedwordpress_syndicated_post' ) ) {
function ucc_cpt_feedwordpress_syndicated_post ( $data ) {
$feed = $data['meta']['syndication_feed'];
// Adjust stripos contents as needed.
if ( stripos( 'colourlovers.com/rss/lover/username/palettes/favorites', $feed ) !== false ) {
$data['post_type'] = 'colourlovers-palette';
} elseif ( stripos( 'colourlovers.com/rss/lover/username/colors/favorites', $feed ) !== false ) {