Skip to content

Instantly share code, notes, and snippets.

Lee Peterson leepeterson

View GitHub Profile
View Flarum+Cloudflare Full SSL - Nginx Configuration
# HTTPS Server
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
root /var/www/html;
index index.html index.htm index.php;
ssl_certificate /etc/nginx/ssl/;
ssl_certificate_key /etc/nginx/ssl/;

Keybase proof

I hereby claim:

  • I am leepeterson on github.
  • I am lee_ ( on keybase.
  • I have a public key ASBqoE2LA3QwrdQNfxhtGnVIeOy4XzTlxHUD0Y6CHoZpOgo

To claim this, I am signing this object:

leepeterson / gist:2a00685bf9ffa0d7d2a421ad841f2598
Created Feb 21, 2020 — forked from tomjn/gist:6140909
If you're thinking of using WP_Query, try using this iterator instead, cleaner boilerplate, auto-cleans up after itself
View gist:2a00685bf9ffa0d7d2a421ad841f2598
$pages = new query_loop( array(
'post_type' => 'page'
foreach( $pages as $id => $post ) {
// etc...
leepeterson / ajax-endpoint.js
Created Feb 21, 2020 — forked from jtsternberg/ajax-endpoint.js
Proof of concept for avoiding admin-ajax for ajax callback requests. Also see Thomas Griffin's excellent post: AND Josh Pollock's excellent post:
View ajax-endpoint.js
$('body').on( 'click', '.some-button', function(){
$.ajax( ajax_endpoint_data.api_url, {
type : 'POST',
dataType : 'json',
data : {
action: 'ajax_action',
some_data: 'some_value'
leepeterson /
Created Sep 28, 2019 — forked from AlamoudiAM/
[React snippets] from Udacity Nanodegree #React

Udacity HTML, CSS, JS Style Guide

  • A good function should follow the "DOT" rule:

    • Do One Thing
  • Composition is to combine simple functions to build more complicated ones

    • React builds up pieces of a UI using components.
      • كل فنكشن ترجع UI
  • Declarative code vs imperative code

View path-dispatch.php
* Path Dispatch
* =============
* Simply and easily add a URL which fires an action, triggers a callback, and/or loads a template.
* Basic Usage: at any point before init,
* Path_Dispatch()->add_path( array( 'path' => 'some-path', 'callback' => 'some_function' ) );
leepeterson / restapi.txt
Created Jul 17, 2019 — forked from chrismccoy/restapi.txt
WordPress REST API Resources
View restapi.txt
Allow ALL cross origin requests to WordPress REST API
WordPress theme using Rest API and Vue.js
WordPress Post from Front End using REST API and Vue.js
An offline-first SPA using Vue.js, the WordPress REST API and Progressive Web Apps
View macos slack colors
body{background:#1C2631;color:#96BDC7}a{color:#96BDC7}a:link,a:visited{color:#96BDC7}a:active,a:focus,a:hover{color:#c7c7c7}hr{border-bottom:1px solid #1C2631;border-top:1px solid #1C2631}h1,h2,h3,h4{color:#96BDC7}h1 a{color:#96BDC7}h1 a:active,h1 a:hover,h1 a:link,h1 a:visited{color:#96BDC7}.bordered{border:1px solid #1C2631}.top_border{border-top:1px solid #1C2631}.bottom_border{border-bottom:1px solid #1C2631}.left_border{border-left:1px solid #1C2631}.right_border{border-right:1px solid #1C2631}.bullet{color:#96BDC7}.alert,.c-alert,.c-alert--boxed{background-color:#1C2631;border-color:#1C2631;color:#96BDC7;text-shadow:0 1px 0 rgba(28, 38, 48, 0.5)}.alert h4,.c-alert h4,.c-alert--boxed h4{color:#96BDC7}.alert-info{background-color:#1C2631;border-color:#1C2631;color:#96BDC7}.alert-info h4{color:#96BDC7}::-webkit-scrollbar-track{background:#1C2631 !important;border-left-color:#1C2631 !important;border-right-color:#1C2631 !important;color:#1C2631 !important}::-webkit-scrollbar-thumb{background:#1C2631 !import
leepeterson /
Created Dec 20, 2018 — forked from petemcw/
Mac OS X LEMP Configuration

Mac OS X LEMP Configuration

This Gist is a collection of configuration files that can be used to easily setup a Homebrew-based LEMP stack on Mac OS X.

Files in this repository are numbered and named for ordering purposes only. At the top of each file is a section of metadata that denote what component the file belongs to and the default name & location of the file. Feel free to implement it however you want.

Note: some configuration files have hard-coded paths to my user directory -- fix it for your setup


leepeterson / disable_dash.php
Created Aug 22, 2018 — forked from bryanwillis/disable_dash.php
Different ways to remove wp dashboard widgets. I think disable_dash.php is considered the best method.
View disable_dash.php
remove_action('welcome_panel', 'wp_welcome_panel');
// */
// Create the function to use in the action hook
function remove_default_dashboard_widgets() {
You can’t perform that action at this time.