Skip to content

Instantly share code, notes, and snippets.

View CharlieEtienne's full-sized avatar
🖖
Hi GitHub!

Charlie Etienne CharlieEtienne

🖖
Hi GitHub!
View GitHub Profile
@CharlieEtienne
CharlieEtienne / prod_deploy
Created May 8, 2019 20:18
Production deploy script
#!/bin/bash
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# Replace "username" by your username
ME="username"
@CharlieEtienne
CharlieEtienne / display_included_files.php
Last active May 3, 2019 09:59
Display the names of all files that have been included using include, include_once, require or require_once.
<?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 ) {
@CharlieEtienne
CharlieEtienne / config
Created March 13, 2019 07:49
Git config with two remote repositories (GitHub + Remote server)
[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/*
@CharlieEtienne
CharlieEtienne / copy-ssh-key.sh
Last active October 14, 2018 07:56
Copy SSH Key command on OVH shared hosting
# 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"
@CharlieEtienne
CharlieEtienne / post-update
Last active October 13, 2018 10:30
Git hook "post-update" located in "/home/username/.git/hooks/"
#!/bin/bash
#
# Hook script to pull automatically
# stage branch in /stage folder and master branch in /prod folder
# when a push is detected
# Replace "username" by your username
ME="username"
@CharlieEtienne
CharlieEtienne / .bash_profile
Last active October 13, 2018 10:14
File ".bash_profile" located in "/home/username/"
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# Replace "username" by your username
ME="username"