Skip to content

Instantly share code, notes, and snippets.

View jekkilekki's full-sized avatar

Aaron Snowberger jekkilekki

View GitHub Profile
@jekkilekki
jekkilekki / Fix Vagrant nginx errors.md
Last active November 13, 2017 04:07
Vagrant Nginx binding error fix

I was the following problems with my VVV installation earlier this year. The following are the steps I took to fix things:

Update to PHP7

Since November PHP7 is the default for VVV, but at that time (Sept/Oct), it was not. But it was included on the [develop] branch (not [master]) of VVV.

  1. Switch to [develop] : git checkout develop
  2. git pull

nginx not binding to port 80

@jekkilekki
jekkilekki / git-all-branches.sh
Created October 21, 2016 02:06
Clone ALL branches of a git repo
# From Ray Villalobos' course on AngularJS2
# @link https://www.lynda.com/AngularJS-tutorials/Using-exercises-course/428058/482931-4.html
git clone --bare https://github.com/path/to/repo.git .git # Clones a bare version of the repo
git config --bool core.bare false # Switch bare repo to normal version of the repo
git reset --hard # Repo resets to the master branch at the latest commit
@jekkilekki
jekkilekki / slide-in-images.css
Created January 10, 2017 07:45
Slide in as you scroll down boxes
/**
* Sliding Image Panels
*/
.slide-panel:not(first-child) {
border-top: 1px solid #ddd;
}
.slide-panel .entry-header {
width: 58%;
}
.slide-panel .entry-content {
@jekkilekki
jekkilekki / wp-social-menu.md
Created September 22, 2015 09:12
Social Menu Code from Justin Tadlock

Register Social menu in functions.php

register_nav_menus( array(
    'top'     => esc_html__( 'Top Menu', 'theme-slug' ),
    'social'  => esc_html__( 'Social Menu', 'theme-slug' ),
) );

Create menu in inc/template-tags.php

@jekkilekki
jekkilekki / add-items.js
Created July 7, 2021 05:04
CodePen JS Shopping App Code
let STORE_BUTTON = document.querySelector('.add-item-button');
let STORE_INPUT = document.getElementById('add-item-input');
// Store button
STORE_BUTTON.onclick = function() { handleAdd() };
// Add item on keyboard ENTER
STORE_INPUT.addEventListener('keyup', function(e) {
if ( e.keyCode === 13 ) {
STORE_BUTTON.click();
@jekkilekki
jekkilekki / wp-walker-menu.php
Last active November 20, 2021 19:27
Create a Custom Menu Walker for a WordPress Menu
<?php
/**
* Add this code to your functions.php file
* @link https://codex.wordpress.org/Function_Reference/wp_nav_menu#Using_a_custom_Walker_class
*/
class themeslug_walker_nav_menu extends Walker_Nav_Menu {
// add classes to ul sub-menus
function start_lvl( &$output, $depth = 0, $args = array() ) {
@jekkilekki
jekkilekki / README.md
Last active June 11, 2022 22:17
New Website (WordPress) Helpers

New Website (WordPress) Helpers

These website building helpers are originally extracted from the WordPress TwentyTwenty Theme and are intended to provide easy access to some of the most common basic styles for a website.

This Gist will be occasionally updated with my own preferences for these styles. Files include the following:

File Purpose
PHP