Skip to content

Instantly share code, notes, and snippets.

View jekkilekki's full-sized avatar

Aaron Snowberger jekkilekki

View GitHub Profile
@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 / 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 / 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 / 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 / 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 / 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 / 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 / update_wp_pass_phpmyadmin.sql
Created January 9, 2017 08:11
How to Update your WP Password via phpMyAdmin (SQL)
UPDATE `wp_users` SET `user_pass`= MD5('yourpassword') WHERE `user_login`='yourusername';
@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 / data.xml
Last active January 14, 2017 11:05
D3 Data Visualization data
<?xml version="1.0" encoding="utf-8"?>
<data>
<dat id='1990'><top>82</top><middle>5</middle><bottom>9</bottom></dat>
<dat id='1991'><top>47</top><middle>91</middle><bottom>11</bottom></dat>
<dat id='1991'><top>48</top><middle>60</middle><bottom>11</bottom></dat>
<dat id='1992'><top>61</top><middle>96</middle><bottom>97</bottom></dat>
<dat id='1993'><top>40</top><middle>13</middle><bottom>9</bottom></dat>
<dat id='1994'><top>99</top><middle>32</middle><bottom>23</bottom></dat>
<dat id='1995'><top>93</top><middle>7</middle><bottom>37</bottom></dat>
<dat id='1996'><top>62</top><middle>41</middle><bottom>95</bottom></dat>