# Show git branch name
force_color_prompt=yes
color_prompt=yes
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
This file contains hidden or 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 | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
use Illuminate\Support\Facades\Storage; | |
class MediaController extends Controller | |
{ | |
/** |
This file contains hidden or 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 | |
/** | |
* Create unique slug for post | |
*/ | |
public static function generateSlug($title) | |
{ | |
$slug = substr(str_slug($title), 0, 175); // Slug length will be 175 charecter | |
$latestSlug = static::whereRaw("slug = '$slug' or slug LIKE '$slug-%'")->value('slug'); | |
if(!empty($latestSlug)){ |
This file contains hidden or 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 | |
/* | |
|--------------------------------------------------- | |
| PHP class to send HTTP request in better way | |
|--------------------------------------------------- | |
*/ | |
if(!class_exists('setHTTPRequest')){ | |
class setHTTPRequest | |
{ | |
/** |
This file contains hidden or 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 | |
function affilate_list_pagination($total_items, $total_pages, $current){ | |
$output = '<span class="displaying-num">'.sprintf(_n('%s item', '%s items', $total_items), number_format_i18n($total_items)).'</span>'; | |
$removable_query_args = wp_removable_query_args(); | |
$current_url = set_url_scheme('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); |
This file contains hidden or 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
/* JavaScript */ | |
jQuery(document).ready(function($){ | |
// browser window scroll (in pixels) after which the "back to top" link is shown | |
var offset = 300, | |
//browser window scroll (in pixels) after which the "back to top" link opacity is reduced | |
offset_opacity = 1200, | |
//duration of the top scrolling animation (in ms) | |
scroll_top_duration = 700, | |
//grab the "back to top" link | |
$back_to_top = $('.cd-top'); |
This file contains hidden or 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
var PrintContent = jQuery("div.col-sm-12 > div.inner"), | |
PrintContentClone = PrintContent.clone(); | |
$('<iframe>', { | |
name: 'myprintiframe', | |
class: 'productPrintFrame' | |
}) | |
.appendTo('body') | |
.contents().find('body') | |
.append(PrintContentClone); |
This file contains hidden or 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
//Checked Check box | |
jQuery(':checkbox').prop("checked", true); | |
//Click all buttons at a time | |
jQuery('.row-options .delete-field').trigger("click"); |
This file contains hidden or 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 | |
function wp_bootstrap_pagination(){ | |
$search_paging = get_the_posts_pagination(array( | |
'prev_text' => __( 'Previous', '' ), | |
'next_text' => __( 'Next', '' ), | |
'mid_size' => 2 | |
)); |