Skip to content

Instantly share code, notes, and snippets.

View jbalzar's full-sized avatar

Jessie Baltazar jbalzar

View GitHub Profile
@jbalzar
jbalzar / gulp.js
Created August 24, 2015 08:33
BrowserSync for Laravel Elixir
/**
* gulp.js file
*
* Github Repo
* https://github.com/ponko2/laravel-elixir-browser-sync
*
* Node Install
*
* Laravel Elixir 2.x
* npm install laravel-elixir-browser-sync@0.1.7 --save-dev
@jbalzar
jbalzar / node-for-root-user
Last active April 23, 2016 05:52
NodeJS fix for "/usr/bin/env: node: No such file or directory"
"ln -s /usr/bin/nodejs /usr/bin/node"
@jbalzar
jbalzar / mailcatcher.bash
Last active April 23, 2016 05:52
Enable Mailcatcher on Linux
# http://mailcatcher.me/
gem install mailcatcher
# $ mailcatcher --help
# Usage: mailcatcher [options]
# --ip IP Set the ip address of both servers
# --smtp-ip IP Set the ip address of the smtp server
# --smtp-port PORT Set the port of the smtp server
# --http-ip IP Set the ip address of the http server
@jbalzar
jbalzar / composer.bash
Last active April 23, 2016 05:51
Install composer on ubuntu
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
@jbalzar
jbalzar / mcrypt
Created September 4, 2015 18:11
Install mcrypt module ubuntu
sudo apt-get install mcrypt php5-mcrypt
sudo php5enmod mcrypt
sudo service apache2 restart
@jbalzar
jbalzar / genesis_custom_widget_area.php
Last active March 19, 2016 11:46
Custom widget area in Genesis
<?php
add_action( 'genesis_after_header', 'custom_widget_name' );
function custom_widget_name() {
genesis_widget_area ('custom_widget_name', array(
'before' => '<div class="custom_widget_name"><div class="wrap">',
'after' => '</div></div>',
) );
}
@jbalzar
jbalzar / genesis_remove_post.php
Last active March 19, 2016 11:45
Remove post in Genesis homepage
<?php
add_action ( 'get_header' , 'home_remove_post' );
function home_remove_post() {
if( is_home() || is_front_page() ) {
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
}
}
@jbalzar
jbalzar / genesis_custom_featured_post_widget_html.js
Created March 19, 2016 11:20
Custom Genesis Featured Post Widget thru Javasript
//* Modify Genesis Featured Post HTML structure
$('.featuredpost article').each(function(index) {
//* Element variables
var $thumbnail = $(this).find('a.alignleft');
var $header = $(this).find('.entry-header');
var $content = $(this).find('.entry-content');
$thumbnail.removeClass('alignleft');
//* Apply Genesis column classes
$thumbnail.addClass('one-fourth');
@jbalzar
jbalzar / woocommerce_product_cat_img.php
Created March 19, 2016 11:44
Get Category Image in WooCommerce
<?php
$thumbnail_id = get_woocommerce_term_meta( $category->term_id, 'thumbnail_id', true );
$cat_image = wp_get_attachment_url( $thumbnail_id );
?>
@jbalzar
jbalzar / laravel-centos6.bash
Last active July 13, 2017 19:40
Setup Laravel on LAMP stack on CentOS
# Commands to install required packages
sudo yum -y update
sudo yum -y install epel-release
sudo yum -y wget
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
wget https://centos6.iuscommunity.org/ius-release.rpm
sudo rpm -Uvh ius-release*.rpm
sudo yum -y update
sudo yum -y install php56u php56u-opcache php56u-xml php56u-mcrypt php56u-gd php56u-devel php56u-mysql php56u-intl php56u-mbstring php56u-bcmath