Skip to content

Instantly share code, notes, and snippets.

View zachary-russell's full-sized avatar

Zachary Russell zachary-russell

View GitHub Profile
@zachary-russell
zachary-russell / premise-cpt-support.php
Last active December 15, 2015 22:09
Add premise landing page membership support to custom post types
<?php
add_action('init', 'add_premise_member_support');
function add_premise_member_support() {
$post_type=cpt; //replace this with the name of your custom post type
add_post_type_support( $post_type, 'premise-member-access' );
}
?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<h2><?php the_title(); ?><h2>
<?php the_post_thumbnail(); ?>
<?php the_excerpt(); ?>
<?php endwhile; else: ?>
<p>Sorry, no posts exist</p>
<?php endif; ?>
@zachary-russell
zachary-russell / javascript_resources.md
Created December 3, 2013 09:28 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@zachary-russell
zachary-russell / python_resources.md
Created December 3, 2013 09:28 — forked from jookyboi/python_resources.md
Python-related modules and guides.

Packages

  • lxml - Pythonic binding for the C libraries libxml2 and libxslt.
  • boto - Python interface to Amazon Web Services
  • Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
  • PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
  • Celery - Task queue to distribute work across threads or machines.
  • pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

Guides

@zachary-russell
zachary-russell / css_resources.md
Created December 3, 2013 09:28 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@zachary-russell
zachary-russell / show-cpt.php
Created December 7, 2013 18:44
Show CPT on Home Page
<?php
/**
* Show WordPress custom post types on the main blog and archive pages
*
* @param WP_Query $query
**/
function show_custom_post_types( $query ) {
// Show all custom post types on main blog and archive pages
@zachary-russell
zachary-russell / wordpress.conf
Last active August 29, 2015 14:11
Nginx Virtual Host HHVM w/ WordPress
server {
listen 80;
server_name localhost; # or replace localhost with domain name
include hhvm.conf;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
root /var/www;
index index.php;
@zachary-russell
zachary-russell / plugin.php
Created March 31, 2015 15:46
WordPress Plugin Starter File
<?php
/**
* Plugin Name: My Plugin
* Plugin URI:
* Description:
* Version: 1.0
* Author: ProTech Internet Group
* Author URI: https://protechig.com
* License: GPL2
* /
@zachary-russell
zachary-russell / googlefonts.php
Created May 29, 2015 22:02
Google Font WordPress
function pt_add_google_fonts() {
wp_enqueue_style('google-fonts', 'http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,400,700,300');
}
add_action( 'pt_add_google_fonts', 'wp_enqueue_scripts' );
@zachary-russell
zachary-russell / index.js
Created October 4, 2017 17:13
Google Cloud Form Processing Script
var api_key = 'YOUR-KEY-HERE';
var sending_domain = 'sandbox3d603fef70dc4a3db61d4f9de9854c46.mailgun.org';
var mailgun = require('mailgun-js')({apiKey: api_key, domain: sending_domain});
exports.processForm = function processForm(req, res) {
query = req.query;
var data = {
from: query.fname + ' ' + query.lname + ' <' + decodeURIComponent(query.email) + '>',
to: '[email protected]',