$ sudo npm install -g hexo-cli
$ hexo -v
hexo-cli: 0.1.9
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 my_redirect_single_post() { | |
| if (is_search()) { | |
| global $wp_query; | |
| if ($wp_query->post_count == 1 && $wp_query->max_num_pages == 1) { | |
| wp_redirect( get_permalink( $wp_query->posts['0']->ID ) ); | |
| 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 | |
| function my_registration_redirect(){ | |
| return home_url( '/finished/' ); | |
| } | |
| add_filter( 'registration_redirect', 'my_registration_redirect' ); |
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 | |
| /** | |
| * Add the code below to your theme's functions.php file | |
| * to add a confirm password field on the register form under My Accounts. | |
| */ | |
| function woocommerce_registration_errors_validation($reg_errors, $sanitized_user_login, $user_email) { | |
| global $woocommerce; | |
| extract( $_POST ); | |
| if ( strcmp( $password, $password2 ) !== 0 ) { |
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
| /** | |
| * Replace 'customer' role (WooCommerce use by default) with your own one. | |
| **/ | |
| add_filter('woocommerce_new_customer_data', 'wc_assign_custom_role', 10, 1); | |
| function wc_assign_custom_role($args) { | |
| $args['role'] = 'subscriber'; | |
| return $args; | |
| } |
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
| #!/usr/local/bin/zsh | |
| DirConf="/usr/local/etc" | |
| PIDPATH="/usr/local/var/run" | |
| PHPVersion="5.6" | |
| MYSQL="/usr/local/bin/mysql.server" | |
| NGINX="/usr/local/bin/nginx" | |
| PHPFPM="/usr/local/sbin/php-fpm" | |
| MEMCACHED="/usr/local/bin/memcached -m 24 -P $PIDPATH/memcached.pid -u root" |
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
| <IfModule mod_rewrite.c> | |
| RewriteEngine On | |
| RewriteBase / | |
| RewriteCond %{HTTP_HOST} !^$ | |
| RewriteCond %{HTTP_HOST} !^www\. [NC] | |
| RewriteCond %{HTTPS}s ^on(s)| | |
| RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301] | |
| RewriteCond %{THE_REQUEST} ^GET\ (.*)\.html\ HTTP |
Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
| Commit type | Emoji |
|---|---|
| Initial commit | π :tada: |
| Version tag | π :bookmark: |
| New feature | β¨ :sparkles: |
| Bugfix | π :bug: |
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
| // Implementation in ES6 | |
| function pagination(c, m) { | |
| var current = c, | |
| last = m, | |
| delta = 2, | |
| left = current - delta, | |
| right = current + delta + 1, | |
| range = [], | |
| rangeWithDots = [], | |
| l; |
Inspiration: Deis Commit Style Guide
I often quote Deis in sections below.
It makes going back and reading commits easier. It also allows you to spend less time thinking about what your commit message should be.