Skip to content

Instantly share code, notes, and snippets.

View bfintal's full-sized avatar
🎯
Focusing

Benjamin Intal bfintal

🎯
Focusing
View GitHub Profile
@bfintal
bfintal / Development.md
Last active April 8, 2019 03:37
Creating a Custom Client WordPress Website from A PSD Design - A Gambit Technologies, Inc. Developer Guide

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 April 6, 2018 05:43
Frontly Toolbar API

Toolbar API

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

Table of Contents

<?php
add_action( 'wp_footer', 'add_my_templates', 11 );
function add_my_templates() {
if ( ! class_exists( 'PageBuilderSandwich' ) ) {
return;
}
if ( PageBuilderSandwich::is_editable_by_user() ) {
// 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 ) {
} );
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
} ) )
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() {
// See: https://docs.woocommerce.com/wc-apidocs/class-WC_Order.html
$order = new WC_Order( $order_id );
$order->add_coupon( 'couponcode' );
$order->calculate_totals();
@bfintal
bfintal / wp_dev_install.sh
Last active June 11, 2018 23:20
WordPress development tools that I need in MacOSX. At the end of this, you can have linter-phpcs working with WP standards (helpful for Atom) and scss compilation among others. Note to self: will still need to install xcode & command line tools.
#!/bin/bash
# FILE="/tmp/out.$$"
# GREP="/bin/grep"
# Make sure only normal users can run our script since we have sudos in the commands.
if [ "$(id -u)" == "0" ]; then
echo "This script must be run as a normal user" 1>&2
exit 1
fi
@bfintal
bfintal / gist:c0951481922318e1f0ae1837216737da
Last active September 2, 2016 09:54
Cleans up the colors of icons in the admin main menu, TinyMCE buttons, and buttons beside the "Add Media" button. Inspired by Ahmad Awais' post https://ahmadawais.com/bad-icon-wp-admin/
/* Adjust admin menu icons */
#adminmenu li div.wp-menu-image img {
opacity: 1;
-webkit-filter: contrast(100%) invert(1) sepia(100%) grayscale(1) contrast(75%);
filter: contrast(100%) invert(1) sepia(100%) grayscale(1) contrast(75%)
}
#adminmenu li:hover div.wp-menu-image img {
-webkit-filter: invert(1) grayscale(100%) sepia(100%) saturate(1000%) hue-rotate(170deg);
filter: invert(1) grayscale(100%) sepia(100%) saturate(1000%) hue-rotate(170deg);
}