Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Benjamin Intal bfintal

🎯
Focusing
Block or report user

Report or block bfintal

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:d711cd81b36a41cd4d25a1012eeb3a82
.ugb-image-upload-has-placeholder[data-is-placeholder-visible="true"] {
display: flex !important;
}
View gist:b653fa49d2c7b2c8ff11d21f029390ec
setTimeout( function() {
var ttes = document.querySelectorAll( '.tte_wrapper' );
Array.prototype.forEach.call( ttes, function( el ) {
var typeAttr = el.getAttribute( 'data-effect' );
// Make the element visible and remove original text.
// Original text is for SEO.
var mid = el.querySelector( '.tte_mid' );
mid.innerHTML = '';
mid.style.opacity = '';
@bfintal
bfintal / cheatsheet.js
Created Feb 6, 2019
Gutenberg Cheat Sheet
View cheatsheet.js
// Get the data of a block
wp.data.select( 'core/editor' ).getBlocks()[0]
// Update attributes of another block
// wp.data.dispatch( 'core/editor' ).updateBlockAttributes( clientID, attributes )
wp.data.dispatch( 'core/editor' ).updateBlockAttributes( '10d88a6d-95d6-4e07-8293-5f59c83a26c0', { heading: 'New Heading' } )
// Get currently selected block.
wp.data.select( 'core/editor' ).getBlockSelectionStart()
@bfintal
bfintal / Development.md
Last active Apr 8, 2019
Creating a Custom Client WordPress Website from A PSD Design - A Gambit Technologies, Inc. Developer Guide
View Development.md

Creating a Custom Client WordPress Website from A PSD Design

(This is a Gambit Technologies, Inc. Developer Guide)

Development of a website from scratch is done by:

  1. Creating a customized WordPress theme using Sage by Roots,
  2. Creating the pages then creating the content either using a page builder, or by adding pure HTML content, then adding styles into the customized theme,
  3. Installing plugins from the WordPress plugin directory for added functionality, configuring them and customizing their styles.

We will use the following tools/projects/code bases:

@bfintal
bfintal / toolbar.md
Last active Apr 6, 2018
Frontly Toolbar API
View toolbar.md

Toolbar API

Create toolbar buttons which can be assigned to elements. Toolbars appear when elements are hovered on.

Table of Contents

View fix_ampersand_permalink.php
View add_my_templates.php
<?php
add_action( 'wp_footer', 'add_my_templates', 11 );
function add_my_templates() {
if ( ! class_exists( 'PageBuilderSandwich' ) ) {
return;
}
if ( PageBuilderSandwich::is_editable_by_user() ) {
View gulpfile.js
// Copy all project files into the build directory for packaging
gulp.task( 'buildFiles', [ 'updatePageTemplateSamples', 'premium-lite', 'buildStart', 'styles', 'scripts', 'styles-inc', 'scripts-inc', 'translations', 'translations-update', 'icons', 'google-font-update-list' ], function() { // 'standards-phpcs',
return gulp.src( buildInclude, { base: './' } )
.pipe( gulp.dest( 'dist/' + folderName ) )
.pipe( notify( { message: 'Copy build files complete', onLast: true } ) );
} );
gulp.task( 'buildOtherStuff', ['buildFiles'], function( callback ) {
} );
View gulpfile.js
gulp.task( 'icon-font', function() {
return gulp.src( ['page_builder_sandwich/assets/editor-icons/*.svg'] )
.pipe( iconfont( {
fontName: 'pbs', // Required
appendUnicode: true, // Recommended option
formats: ['ttf', 'eot', 'woff'], // Default, 'woff2' and 'svg' are available
timestamp: runTimestamp, // Recommended to get consistent builds when watching files
normalize:true,
fontHeight: 1001
} ) )
View gist:422e0146d6f7b91e9c77880c2ac09266
gulp.task( 'google-font-download-list', function() {
var url = 'https://www.googleapis.com/webfonts/v1/webfonts?key=AIzaSyDS1XfK5O1n2KXV3a1sonEffs966tQt54g';
return download( url )
.pipe( rename( {
basename: 'google-fonts',
extname: '.json'
} ) )
.pipe( gulp.dest( '.' ) );
} );
gulp.task( 'google-font-update-list', ['google-font-download-list'], function() {
You can’t perform that action at this time.