| gitflow | git |
|---|---|
git flow init |
git init |
git commit --allow-empty -m "Initial commit" |
|
git checkout -b develop master |
SSH into your server and stay in the home directory of the user.
Check if you have a bin directory in your user directory already, in case you do, omit the mkdir bin.
For the commands to be loaded from the bin directory run echo "export PATH=$HOME/bin:$PATH" >> ~/.bashrc. For the new config to be used run source ~/.bashrc or close and reopen your SSH session.
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 | |
| /** | |
| * Disables the #wpadmin bar for users without "edit_posts" permissions. | |
| */ | |
| function prefix_hide_admin_bar() { | |
| if ( ! current_user_can( 'edit_posts' ) ) { | |
| add_filter( 'show_admin_bar', '__return_false' ); | |
| } | |
| } | |
| add_action( 'after_setup_theme', 'prefix_hide_admin_bar' ); |
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 | |
| /** | |
| * Redirects subscribers back to the home page if they attempt to access the dashboard. | |
| */ | |
| function prefix_redirect_admin() { | |
| if ( ! current_user_can( 'edit_posts' ) && ! defined( 'DOING_AJAX' ) ) { | |
| wp_safe_redirect( home_url() ); | |
| exit; | |
| } | |
| } |
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 | |
| /** | |
| * Allows visitors to log in using e-mail address | |
| * | |
| * @param string username passed by reference | |
| */ | |
| function prefix_authenticate_by_email( &$username ) { | |
| $user = get_user_by( 'email', $username ); | |
| if ( false !== $user ) { | |
| $username = $user->user_login; |
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
| wget http://wordpress.org/latest.tar.gz && tar xvzf latest.tar.gz && mv ./wordpress/* ./ && rm -rf ./wordpress && cp ./wp-config-sample.php ./wp-config.php |
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
| alias lsa='ls -la' | |
| alias ..="cd .." | |
| # GIT RELATED SHORTCUTS | |
| alias lg='git log --graph --full-history --all --color --pretty=format:"%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s"' | |
| alias gl="git log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" | |
| alias gs="git status" | |
| alias gm="git commit -m" | |
| alias gb="git branch" |
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 getExtension($url = '') { | |
| if ( empty($url) ) { | |
| return false; | |
| } | |
| $domain = content_url() . '/uploads/'; | |
| $url = str_replace($domain, '', $url); | |
| $reversed = strrev($url); | |
| $dotPosition = strpos($reversed, '.' ); | |
| $extension = strrev(substr($reversed,0,$dotPosition)); |
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 hack = document.createElement("div"); | |
| hack.style.height = "101%"; | |
| document.body.appendChild(hack); | |
| setTimeout(function(){ | |
| document.body.removeChild(hack); | |
| hack = null; | |
| }, 0); |
NewerOlder