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_filter( 'attachment_fields_to_edit', function( $form_fields, $post ) { | |
$form_fields[ 'elementor_carousel_custom_link' ] = array( | |
'label' => __( 'Custom link', 'elementor' ), | |
'input' => 'text', | |
'value' => get_post_meta( $post->ID, 'elementor_carousel_custom_link', true ), | |
'helps' => __( 'This will add a link to images in Elementor Carousel', 'elementor' ), | |
); |
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 | |
define('BASEDIR', "splitted/"); | |
$unite = 0; | |
foreach( glob("MODULE*/*/imsmanifest.xml") as $file ) { | |
$chapitre = 0; | |
$parent_dir = dirname($file); | |
$dest_parent_dir = BASEDIR . $parent_dir; | |
$xmlstr = file_get_contents($file); |
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
$curUser = (Get-ChildItem Env:\USERNAME).Value | |
$curComp = (Get-ChildItem Env:\COMPUTERNAME).Value | |
$pvmaj = $Host.Version.Major | |
$pvmin = $Host.Version.Minor | |
$psversion = "$pvmaj.$pvmin" | |
$identity = "$curUser@$curComp" | |
#----------------------------------------------------- | |
# WINDOW TITLE |
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\Database\Eloquent\Collection; | |
// Register in 'boot()' method in app/Providers/AppServiceProvider.php | |
// This allows you to call ->paginate() on an Eloquent Collection | |
Collection::macro('paginate', function ($perPage = 10, $current_page = null, $options = []) { | |
$current_page = $current_page ?: (Paginator::resolveCurrentPage() ?: 1); | |
return (new LengthAwarePaginator($this->forPage($current_page, $perPage)->values()->all(), $this->count(), $perPage, $current_page, $options))->withPath(''); | |
}); |
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 | |
# Get the aliases and functions | |
if [ -f ~/.bashrc ]; then | |
. ~/.bashrc | |
fi | |
# Replace "username" by your username | |
ME="username" |
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 | |
# Get the aliases and functions | |
if [ -f ~/.bashrc ]; then | |
. ~/.bashrc | |
fi | |
# Replace "username" by your username | |
ME="username" |
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 | |
if ( ! function_exists( 'display_included_files' ) ) { | |
/** | |
* Display the names of all files that have been included using include, include_once, require or require_once. | |
* | |
* @param bool|array $filters Array of strings to filter results. Ex: ['my-template', 'elementor']. | |
* @param bool $display Display on screen or in javascript console. Default false. | |
*/ | |
function display_included_files( $filters = false, $display = false ) { |
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
[core] | |
repositoryformatversion = 0 | |
filemode = false | |
bare = false | |
logallrefupdates = true | |
symlinks = false | |
ignorecase = true | |
[remote "origin"] | |
url = ssh://[email protected]_adress:22/home/username/git/myproject.git | |
fetch = +refs/heads/*:refs/remotes/origin/* |
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
# Copy SSH Key command on OVH shared hosting | |
# Replace "username", "cluster001" with your personal informations | |
# Replace "~/.ssh/id_ed25519.pub" by the path to your public rsa key if you have a custom one | |
cat ~/.ssh/id_ed25519.pub | ssh ssh://[email protected] "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys" |
NewerOlder