Skip to content

Instantly share code, notes, and snippets.

View jekkilekki's full-sized avatar

Aaron Snowberger jekkilekki

View GitHub Profile
@jekkilekki
jekkilekki / dot-border.svg
Last active December 18, 2016 11:09
SVG to create true round-dotted borders
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jekkilekki
jekkilekki / 01-react-syntax.jsx
Last active December 15, 2016 12:32
Basic ReactJS work
// React Native syntax
var MyComponent = React.createClass({
render() {
return <div>
<h1>Hello World</h1>
<p>This is my first React component!</p>
</div>
}
})
@jekkilekki
jekkilekki / taxonomy-dropdowns.js
Created November 21, 2016 11:33
WordPress taxonomy dropdowns - if too long (default is to show all taxonomies)
jQuery(document).ready(function($) {
/*
* For Taxonomy dropdowns in Post meta
*/
$( '.cat-links .jkl-tax-switch, .tags-links .jkl-tax-switch' ).click( function( e ) {
e.preventDefault();
if( $( this ).next( 'ul' ).hasClass( 'childopen' ) ) {
$( this ).next( 'ul' ).removeClass( 'childopen' );
} else {
@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 / custom-wp-hooks.php
Created October 16, 2016 06:38
Create custom Action and Filter hooks for your plugins in WordPress
<?php
/**
* Learn how to create custom Action and Filter hooks.
*
* @link https://www.lynda.com/PHP-tutorials/Creating-custom-hooks/508212/547129-4.html
*/
/**
* 1. Custom FILTER Hook ------------------------------
*/
@jekkilekki
jekkilekki / customizer-pseudo-elements.js
Last active February 6, 2017 06:21
Use a Background Gradient in WP Customizer + Various other Customizer functions
/**
* Make the WP Customizer also recognize and adjust pseudo- elements like :before and :hover
* Non-instantaneous update - requires partial page refresh
*/
// Highlight colors
wp.customize( 'highlight_color', function( value ) {
value.bind( function( to ) {
$( 'a:visited, a:hover, a:focus, a:active, .entry-content a, .entry-summary a' ).css( {
@jekkilekki
jekkilekki / clearfix.css
Created November 30, 2015 00:52
Collection of Quick CSS Gists
/* Courtesy of CSS Tricks: https://css-tricks.com/snippets/css/clear-fix/ */
.group:after {
content: "";
display: table;
clear: both;
}
@jekkilekki
jekkilekki / jetpack-likes-fix.md
Last active November 13, 2015 04:54
Fix the WP Jetpack Likes text on Pages

With Jetack "Likes" turned on, when logged in, in the wpadminbar, the "Like" button text doesn't line up:

Like text out of line

To fix it, add: line-height: inherit;

To: #wpadminbar .quicklinks li#wp-admin-bar-wpl-like > a { ... }

@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() ) {