This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let g:polyglot_disabled = ['markdown'] | |
call plug#begin() | |
" Project | |
Plug 'ahmedkhalf/project.nvim' | |
" Search | |
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } | |
Plug 'junegunn/fzf.vim' | |
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir ~/bin | |
mkdir ~/bin/wp-cli | |
cd ~/bin/wp-cli | |
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar | |
chmod +x wp-cli.phar | |
echo "export COLUMNS" >> ~/.bashrc | |
echo "alias wp='php ~/bin/wp-cli/wp-cli.phar'" >> ~/.bashrc | |
echo "alias php='/usr/bin/php'" >> ~/.bashrc | |
source ~/.bashrc | |
echo "PATH=$HOME/bin:$PATH" >> ~/.bashrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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 ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#may need to update local branches fist | |
git remote update origin --prune | |
# get all branches that are merged into release | |
# remove the origin/ prefix | |
# make sure we don't delete release, develop and HEAD branches | |
# remove them | |
git branch -r --merged origin/release | sed 's/origin\///' | grep -vwE "(develop|HEAD|release)$" | xargs -n 1 git push origin --delete | |
#for develop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Fixed named events | |
var _events = [ | |
"vc:access:initialize", | |
"vc:access:backend:ready", | |
"shortcodes:vc_row:add:param:name:parallax", | |
"shortcodes:vc_row:update:param:name:parallax", | |
"shortcodes:vc_single_image:sync", | |
"shortcodes:vc_single_image:add", | |
"shortcodes:add:param:type:el_id", | |
"click:media_editor:add_image", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# There are many ways to get a path to a file or script. | |
# This script showcases several of them and their pitfalls. | |
# Credit for most of these techniques comes from: | |
# http://stackoverflow.com/questions/4774054/ | |
abs_path='/usr/bin/bash' | |
rel_path='.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Taken from: http://stackoverflow.com/questions/588040/window-onload-vs-document-onload | |
According to Parsing HTML documents - The end, | |
The browser parses the HTML source and runs deferred scripts. | |
A DOMContentLoaded is dispatched at the document when all the HTML has been parsed and have run. The event bubbles to the window. | |
The browser loads resources (like images) that delay the load event. | |
A load event is dispatched at the window. | |
Therefore, the order of execution will be | |
DOMContentLoaded event listeners of window in the capture phase | |
DOMContentLoaded event listeners of document |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The below function will help to load template file from plugin directory of wordpress | |
* Extracted from : http://wordpress.stackexchange.com/questions/94343/get-template-part-from-plugin | |
*/ | |
define('PLUGIN_DIR_PATH','Your-plugin-directory-path'); | |
function ccm_get_template_part($slug, $name = null) { | |
do_action("ccm_get_template_part_{$slug}", $slug, $name); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> | |
<title>Site Title</title> | |
<link rel="stylesheet" href="/assets/css/style.min.css"> |
NewerOlder