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 | |
function my_elementor_maintenance_mode_whitelist_ips() { | |
// IPs Whitelist | |
$whitelist = [ | |
'127.0.0.1', | |
'88.123.181.218', | |
]; |
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 | |
/** | |
* Add Custom Tab | |
* Add this code to your theme or child theme functions.php file | |
*/ | |
add_filter( 'learn-press/course-tabs', 'wp_education_course_tab_customize' ); | |
function wp_education_course_tab_customize( $tabs ){ |
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 | |
/** | |
* Get the user's roles | |
* @since 1.0.0 | |
*/ | |
function wcmo_get_current_user_roles() { | |
if( is_user_logged_in() ) { | |
$user = wp_get_current_user(); | |
$roles = ( array ) $user->roles; | |
return $roles; // This returns an array |
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
#!/bin/bash | |
# | |
# @Author: Josh Sunnex | |
# @Date: 2019-01-31 10:26:00 | |
# @Last Modified by: josh5 | |
# @Last Modified time: 2019-01-31 10:36:07 | |
# | |
# usage: | |
# curl -sSL https://gist.githubusercontent.com/Josh5/ff6ccfe4c75ae27a3f1efebcb645e7c4/raw/calculate_apache_mpm_config.sh | bash -s [PID] | |
# |
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 | |
namespace App\Traits; | |
/** | |
* Traits that eases the use of ORDER BY FIELD with an eloquent model. | |
* https://github.com/laravel/ideas/issues/1066 | |
*/ | |
trait OrderByField | |
{ |
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 | |
use Illuminate\Support\Facades\Schema; | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Database\Migrations\Migration; | |
class AddRenewsAtColumnToSubscriptions extends Migration | |
{ | |
/** | |
* Run the migrations. |
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
FROM php:7.2.11-fpm | |
WORKDIR /application | |
ENV ACCEPT_EULA=Y | |
# Fix debconf warnings upon build | |
ARG DEBIAN_FRONTEND=noninteractive | |
# Install selected extensions and other stuff | |
RUN apt-get update \ |
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
# Change to the project directory | |
cd $FORGE_SITE_PATH | |
# Turn on maintenance mode | |
php artisan down || true | |
# Pull the latest changes from the git repository | |
# git reset --hard | |
# git clean -df | |
git pull origin $FORGE_SITE_BRANCH |
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 | |
$recursive = $this->query() | |
->recursive('parents', function (Builder $query) { | |
$query | |
->select([ | |
'*', | |
new Alias('slug', 'fullslug'), | |
new Alias(0, 'depth'), | |
new Alias('id', 'tree_id'), | |
new Alias('name', '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
$client = new Client(); | |
$array = []; | |
$res = $client->request('POST', $url, [ | |
'body' => json_encode($array), | |
'headers' => [ | |
'Content-Type' => 'application/json', | |
] | |
]); |
NewerOlder