Skip to content

Instantly share code, notes, and snippets.

View jbalzar's full-sized avatar

Jessie Baltazar jbalzar

View GitHub Profile
@jbalzar
jbalzar / settings.json
Last active December 24, 2018 13:23
VS Code with Vim
{
"workbench.colorTheme": "One Monokai",
"window.zoomLevel": 0,
"vim.easymotion": true,
"vim.incsearch": true,
"vim.useSystemClipboard": true,
"vim.useCtrlKeys": false,
"vim.hlsearch": true,
"vim.insertModeKeyBindings": [
{
@jbalzar
jbalzar / keymap.cson
Created May 29, 2016 12:46
Atom vim-mode-plus extra keybindings
'atom-text-editor.vim-mode-plus:not(.normal-mode)':
'j j': 'vim-mode-plus:activate-normal-mode'
'atom-text-editor.vim-mode-plus:not(.insert-mode)':
', w': 'core:save'
@jbalzar
jbalzar / Vagrantfile.rb
Created April 25, 2016 05:32
Set scotchbox default document root to /var/www
config.vm.provision "shell", inline: <<-SHELL
mv /var/www/public /var/www
sudo sed -i s,/var/www/public,/var/www,g /etc/apache2/sites-available/000-default.conf
sudo sed -i s,/var/www/public,/var/www,g /etc/apache2/sites-available/scotchbox.local.conf
sudo service apache2 restart
SHELL
@jbalzar
jbalzar / package-management.bash
Created April 24, 2016 07:55
CentOS package management
# Update packages
sudo yum update
# Search package
sudo yum search package_name
# Install package
# -y : confirm the installation with no prompt
sudo yum -y install package_name
@jbalzar
jbalzar / user-management.bash
Created April 24, 2016 07:47
User Management on Linux server
# Add new user
sudo useradd newuser
# Set password for newuser user
sudo passwd newuser
# Delete newuser user
sudo userdel newuser
# Create a group
@jbalzar
jbalzar / date.bash
Created April 24, 2016 07:35
Date on Linux server
# Check date
date
# Change date format MMddhhmmyyyy.ss
sudo date 123122302016.45
@jbalzar
jbalzar / sudoer.bash
Last active April 24, 2016 07:51
Create user and add to sudoer
# Create new user
sudo useradd liz
# Set password for user
sudo passwd liz
# Add user to wheel group
sudo usermod -g wheel liz
# Check user group
@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
@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 / 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');