composer create-project --prefer-dist laravel/laravel blog
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
| <?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
| <?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 | |
| /** | |
| * 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 | |
| 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 | |
| // Show all php errors | |
| ini_set('display_errors', 1); | |
| ini_set('display_startup_errors', 1); | |
| error_reporting(E_ALL); | |
| // END |
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 | |
| /** | |
| * Custom rewrite rule for career page | |
| */ | |
| add_action('init', function(){ | |
| add_rewrite_tag('%office_location%','([^&]+)'); | |
| add_rewrite_tag('%job_position%','([^&]+)'); | |
| }); |
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
| FROM alpine:3.10 | |
| # Install cURL, Zip, Vim | |
| RUN apk update && apk add curl zip vim | |
| # Install PHP | |
| RUN apk add php7 php7-common php7-curl php7-json php7-zip php7-mbstring php7-openssl php7-phar php7-xml | |
| # Install composer | |
| RUN curl -sS https://getcomposer.org/installer | php -- \ |