Skip to content

Instantly share code, notes, and snippets.

@smutek
smutek / Bootstrap5NavWalker.md
Last active October 4, 2024 21:58
Bootstrap 5 Nav Walker for Sage 10

Bootstrap 5 Walker for Sage 10

Forked from the clean NavWalker from the Roots/Soil Plugin which was deprecated in favor of acorn-prettify via composer. I'm using acorn-prettify in my project and as far as I can tell it does not include the clean NavWalker markup from Soil. This fork maintains the features of Soil's clean NavWalker and adds required Bootstrap 5 css classes to the Walker_Nav_Menu in a Sage 10 project.

I'm using this currently in a project along with acorn-prettify and everything appears to be working fine. Does not require acorn-prettify to work. Use at your own risk.

@donaldpipowitch
donaldpipowitch / README.md
Last active December 11, 2025 14:28
Use GitLab Pages to deploy a Storybook per branch

It's quite straightforward to use GitLab Pages to deploy a Storybook instance per branch (and remove it whenever the branch will be removed). And yeah, it's irony to document this in a GitHub Gist 😅

You just need a .gitlab-ci.yml like this one:

stages:
  - setup
  - build-and-test
  - deployment
  - pages
@Xilonz
Xilonz / field.php
Created June 21, 2019 11:13
Sage 9 Carbon Field Blocks
<?php
namespace App;
use Carbon_Fields\Field;
use Carbon_Fields\Block;
Block::make( __( 'Gutenberg Block' ) )
->set_icon( 'format-chat')
->add_fields( array(
Field::make( 'rich_text', 'text', __( 'text', 'my-theme' ) )
@Xilonz
Xilonz / setup.php
Created February 27, 2018 10:50
Sage Wordpress Query Loop for Blade templates
/**
* Add this to your setup.php
* Usage @loop( $wp_query ) or $loop and end with @endloop
* the new $loop variable is available
*/
/**
* Create @loop Blade directive
*/
sage('blade')->compiler()->directive('loop', function ( $query = null ) {
<?php
/**
* @package Kinsta_widget
* @version 1.0
*/
/*
Plugin Name: Kinsta Widget
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin
Author: Your Name
@btroncone
btroncone / ngrxintro.md
Last active November 22, 2025 23:04
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@castaneai
castaneai / app.jsx
Created February 27, 2015 10:27
React.js (ES6) Simple Counter
class App extends React.Component {
constructor(props) {
this.state = {
count: 0
}
}
onClick(e) {
this.setState({
count: this.state.count + 1
@joshlevinson
joshlevinson / gist:d92b0a3d2c63ecd62d85
Created October 4, 2014 03:10
Roots Sidebar Display
<?php
/*
* Allows manual override on a per page/post basis
* for the display of the Roots Sidebar
*
* Allows for filtering the post types that show the metabox
*
*/
@jmasonherr
jmasonherr / connect_tutorial_python.py
Created May 12, 2014 18:28
Stripe connect tutorial for python
# coding: utf-8
import json
import stripe
import datetime
# Required for OAuth flow
from rauth import OAuth2Service
# Our secret key from stripe
STRIPE_SECRET_KEY = 'sk_test_xxxxxxxxxxxxx'