Skip to content

Instantly share code, notes, and snippets.

@riskiii
riskiii / add_hooks_outside_structural_wraps.php
Created June 13, 2017 02:12
Adds hooks immediately before and after Genesis structural wraps.
<?php
// Prefixing is recommended if you are not using a namespace.
// namespace TimJensen\GenesisStarter\Setup;
/**
* Adds hooks immediately before and after Genesis structural wraps.
*
* @version 1.1.0
*
* @return void
/**********************************
*
* Replace Header Site Title with Inline Logo
* Fix Genesis bug - when using static front page and blog page (admin reading settings) Home page is <p> tag and Blog page is <h1> tag
* Replace "is_home" with "is_front_page" to correctly display Home page wit <h1> tag and Blog page with <p> tag
*
* @author AlphaBlossom / Tony Eppright
* @link http://www.alphablossom.com
*
************************************/
<?php
/**
* Dont Update the Theme
*
* If there is a theme in the repo with the same name, this prevents WP from prompting an update.
*
* @since 1.0.0
* @param array $r Existing request arguments
* @param string $url Request URL
* @return array Amended request arguments
@riskiii
riskiii / acf-homebuilder-3-mpu.php
Created April 1, 2017 12:25 — forked from badlydrawnben/acf-homebuilder-3-mpu.php
ACF Extras Page Builder - Views files
<section class="mpu mpu-3 <?php if ($mpu_3_box_css):echo $mpu_3_box_css; endif;?>">
<div class="container">
<div class="row <?php if (!empty($mpu_3_collapse)): echo 'no-gutters'; endif; ?>">
<?php if($mpu_3_title): echo '<h3 class="mpu-title">' . $mpu_3_title . '</h3>'; endif; ?>
<div class="col-md-4 mpu-flex box1">
<div class="mpu-item-wrap">
<?php if ($mpu_3_box_1_title):echo '<h3>' . $mpu_3_box_1_title . '</h3>'; endif;?>
<div class="mpu-item-content-wrap">
<?php $image_att = wp_get_attachment_image_src( $mpu_3_box_1_image, $mpu_3_size ); ?>
<?php if ($mpu_3_box_1_image): echo '<div style="background-image: url( '. $image_att[0] . ')" class="mpu-header-image"></div>'; endif; ?>
@riskiii
riskiii / Gulpfile.js
Created February 21, 2017 03:03 — forked from timothyjensen/Gulpfile.js
Automate compiling Sass to CSS and browser refresh using BrowserSync
// Require our dependencies
var gulp = require('gulp');
var sass = require('gulp-sass');
var browserSync = require('browser-sync').create();
gulp.task('styles', function(){
return gulp.src('sass/style.scss')
.pipe(sass({
outputStyle: 'expanded', // Options: nested, expanded, compact, compressed
indentType: 'tab',
@riskiii
riskiii / class-gravity-forms-customizations.php
Created February 14, 2017 06:43 — forked from sblomberg/class-gravity-forms-customizations.php
Enable Gravity Forms honeypot by default
<?php
class Gravity_Forms_Customizations {
public static function init() {
add_action( 'gform_after_save_form', array( __CLASS__, 'enable_honeypot_on_new_form_creation' ), 10, 2 );
}
public static function enable_honeypot_on_new_form_creation( $form, $is_new ) {
if ( $is_new ) {
$form['enableHoneypot'] = true;
@riskiii
riskiii / gulpfile.js
Created February 13, 2017 01:36 — forked from mikaelbr/gulpfile.js
Example gulpfile for complete set-up.
var gulp = require('gulp');
var browserify = require('gulp-browserify');
var concat = require('gulp-concat');
var less = require('gulp-less');
var refresh = require('gulp-livereload');
var lr = require('tiny-lr');
var server = lr();
var minifyCSS = require('gulp-minify-css');
var embedlr = require('gulp-embedlr');
@riskiii
riskiii / dnsmasq OS X.md
Created January 26, 2017 19:12 — forked from ogrrd/dnsmasq OS X.md
Setup dnsmasq on OS X

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.dev domains, e.g. project.dev, awesome.dev and so on, without having to add to your hosts file each time.

Requirements

Install

@riskiii
riskiii / rm_mysql.md
Created January 26, 2017 19:03 — forked from vitorbritto/rm_mysql.md
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

brew remove mysql

@riskiii
riskiii / _part-tabs.scss
Created January 23, 2017 19:49 — forked from magnificode/_part-tabs.scss
Dynamic tabs that switch to an accordion on mobile.
.tabs{
margin: {top:40px;}
&:last-child{
margin: {bottom:80px;}
}
h2{
color: $color-1;
font: {
size: emCalc(36px);
}