Skip to content

Instantly share code, notes, and snippets.


Aaron Snowberger jekkilekki

View GitHub Profile
joepie91 /
Last active Jun 7, 2021
Rendering pages server-side with Express (and Pug)


  • View: Also called a "template", a file that contains markup (like HTML) and optionally additional instructions on how to generate snippets of HTML, such as text interpolation, loops, conditionals, includes, and so on.
  • View engine: Also called a "template library" or "templater", ie. a library that implements view functionality, and potentially also a custom language for specifying it (like Pug does).
  • HTML templater: A template library that's designed specifically for generating HTML. It understands document structure and thus can provide useful advanced tools like mixins, as well as more secure output escaping (since it can determine the right escaping approach from the context in which a value is used), but it also means that the templater is not useful for anything other than HTML.
  • String-based templater: A template library that implements templating logic, but that has no understanding of the content it is generating - it simply concatenates together strings, potenti
View nodejs setup on Dreamhost VPS
1) Make a download dir to store the node source and download it.
mkdir downloads
cd downloads
git clone
Find the latest version
2) List all of the tags in the repository, and check out the most recent.
git tag
git checkout v0.9.9
saas786 / sanitize_checkbox.php
Last active Apr 7, 2019
Sanitization of customizer controls
View sanitize_checkbox.php
* Sanitize Checkbox
// Source:
* Sanitize a checkbox to only allow 0 or 1
* @since 1.2.0
* @access public
CoastalP47 / functions.php
Last active Mar 9, 2017
Split Menu structure for WordPress
View functions.php
/* ==========
Get Split Nav
include $menu_name for the menu you want and $raw=true if you want to return just the menu objects
========== */
function get_split_nav($menu_name=null, $raw=false){
if($menu_name == null || !is_string($menu_name)){
return false;
$output = new stdClass();
paulund / example-wp-list-table.php
Last active May 23, 2021
An example code of using the WP_List_Table class. With Pagination.
View example-wp-list-table.php
* Plugin Name: Paulund WP List Table Example
* Description: An example of how to use the WP_List_Table class to display data in your WordPress Admin area
* Plugin URI:
* Author: Paul Underwood
* Author URI:
* Version: 1.0
* License: GPL2
View custom-gallery-setting.js
justinph / validate_gravatar.php
Created Mar 19, 2013
In wordpress, a better way to check if an author has a gravatar or not. Sometimes you might want to check to see if a gravatar exists and not display any image if there isn't one. Uses the wordpress HTTP and caching apis. A better version of this:
View validate_gravatar.php
* Utility function to check if a gravatar exists for a given email or id
* @param int|string|object $id_or_email A user ID, email address, or comment object
* @return bool if the gravatar exists or not
function validate_gravatar($id_or_email) {
//id or email code borrowed from wp-includes/pluggable.php
$email = '';
getsource / WP_Bag_of_Tricks.txt
Created Oct 26, 2011 — forked from boogah/WP_Bag_of_Tricks.txt
Things I've learned by being DreamHost's resident WordPress nerd.
View WP_Bag_of_Tricks.txt
WP Bag of Tricks
1. Helpful Scripts/Plugins:
Hacks: (Can be extremely resource intensive.)