Skip to content

Instantly share code, notes, and snippets.

View Dorf's full-sized avatar

David Smyth Dorf

View GitHub Profile
@Dorf
Dorf / customcursor.css
Last active January 27, 2019 19:51
[custom cursor] use image for cursor #cursor
body:not(.is-touch) * {
cursor: url(https://uploads-ssl.webflow.com/5c290f904fdbba7493c2f04c/5c4ddff0a29a8f44aeefbb66_reddot.png) 3 3, auto;
cursor: -webkit-image-set(url(https://uploads-ssl.webflow.com/5c290f904fdbba7493c2f04c/5c4ddff0a29a8f44aeefbb66_reddot.png) 1x, url(https://uploads-ssl.webflow.com/5c290f904fdbba7493c2f04c/5c4de00da29a8f4533efbb6f_reddotx2.png) 2x) 3 3, auto;
}
body:not(.is-touch) .cursor-mask,
body:not(.is-touch) .cursor-mask__inner {
z-index: 1100;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
@Dorf
Dorf / gf-filter-view-entries.php
Last active February 13, 2019 15:03
[Gravity Forms allow non-admins to view entries] also delete and export #gravity forms #wordpress #permissions #functions.php
function add_grav_forms_permissions(){
$role = get_role('editor');
$role->add_cap('gravityforms_view_entries');
$role->add_cap('gravityforms_delete_entries');
$role->add_cap('gravityforms_view_entry_notes');
$role->add_cap('gravityforms_export_entries');
}
add_action('admin_init','add_grav_forms_permissions');
@Dorf
Dorf / local-valet-composer.json
Last active February 13, 2019 15:04
[Local Starter Wordpress Composer File] for development #wordpress #development #local #valet
{
"name" : "Vendor/Project",
"description" : "",
"keywords" : [ "wordpress" ],
"license" : "GPL-2.0+",
"authors" : [
{
"name" : "HappyHippopotam.us",
"email" : "[email protected]",
"role" : "Lead Developer"
@Dorf
Dorf / valet-start-local-project
Last active February 13, 2019 15:05
[WP CLI Valet Command Start Project] #valet #wordpress #wp-cli #local #roots #sage
cd ~/Sites/valet/
# https://github.com/aaemnnosttv/wp-cli-valet-command
wp valet new projectname --dbname=agency.project --dbuser=root --dbprefix=wp_ --admin_user=Hippo --admin_password=password [email protected]
# for bedrock:
wp valet new projectname --project=bedrock --dbprefix=wp_
# INSTALL ROOTS: https://roots.io/sage/docs/theme-installation/
# go to themes folder:
composer create-project roots/sage your-theme-name
@Dorf
Dorf / controller.app.php
Last active February 13, 2019 15:04
[Controller App functions for Roots / Sage] example static functions #controller #sage #roots #functions #app #laravel
namespace App\Controllers;
use Sober\Controller\Controller;
class App extends Controller
{
public static function siteLogo()
{
return get_theme_mod('upload_logo');
}
@Dorf
Dorf / controller.page.php
Last active February 13, 2019 15:03
[Controller Page functions for Roots / Sage] #controller #sage #roots #functions #page #laravel
class Page extends Controller
{
// Pass on all fields from Advanced Custom Fields to the view
protected $acf = true;
// Pass on only field_1 from Advanced Custom Fields to the view
// protected $acf = 'project_intro_fields';
// Pass on multiple fields from Advanced Custom Fields to the view
// protected $acf = ['field_1', 'field_2'];
@Dorf
Dorf / faqs.blade.php
Last active February 2, 2024 17:02
[Shortcodes in Sage] Example for FAQs #sage #blade #shortcodes #partials
///////////////////////////
// /resources/views/partials/shortcodes/faqs.blade.php
<ul class="accordion span12" data-allow-all-closed="true" data-deep-link="true" data-deep-link-smudge="true" data-deep-link-smudge-delay="600" data-accordion id="deeplinked-accordion-with-smudge">
@foreach($faqs as $faq)
<li class="accordion-item" data-accordion-item>
<a href="#{{ $category }}{{ $loop->iteration }}" class="accordion-title">{!! $faq->post_title !!}</a>
<div class="accordion-content" data-tab-content id="answer{{ $loop->iteration }}">
{!! $faq->post_content !!}
</div>
</li>
@Dorf
Dorf / admin.php
Last active May 3, 2021 06:59
[Roots Sage starting admin functions] add Color Palette, Gutenberg editor styles, and basic Intervention commands #sage #roots #admin #intervention #gutenberg #editor
<?php
/**
* Admin assets
*/
add_action('admin_enqueue_scripts', function () {
// global $post;
// $my_post_type = 'page';
if ( stristr( $_SERVER['REQUEST_URI'], 'post.php' ) !== false // just for the post editor
// && is_object( $post )
@Dorf
Dorf / .eslintrc.js
Created February 28, 2019 03:11
[ESLint adjustments for developemt] update rules to warning or disable, add to root sage theme file #sage #development
module.exports = {
'root': true,
'extends': 'eslint:recommended',
'globals': {
'wp': true,
},
'env': {
'node': true,
'es6': true,
'amd': true,
@Dorf
Dorf / mundopepsi.com_2022-08-19.lighthouse.report.json
Last active August 19, 2022 22:01
[Mundo Pepsi Lighthouse Desktop | local] homepage Aug 19 https://googlechrome.github.io/lighthouse/viewer/?gist=b7622014f0d4a30cbf0e882b80c53bd0 #lighthouse #audit #pepsi #desktop
{
"lighthouseVersion": "9.6.1",
"requestedUrl": "https://mundopepsi.com/",
"finalUrl": "https://mundopepsi.com/",
"fetchTime": "2022-08-19T20:37:06.772Z",
"gatherMode": "navigation",
"runWarnings": [],
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36",
"environment": {
"networkUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4695.0 Safari/537.36 Chrome-Lighthouse",