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/bin/env bash | |
| if [ "$(uname)" = "Darwin" ]; then | |
| jq=/usr/local/bin/jq | |
| wget=/usr/local/bin/wget | |
| image_folder_path="/Users/$USER/Documents/Images/Bing/" | |
| mkdir -p $image_folder_path |
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
| function sanitize_chinese_user( $username, $raw_username, $strict ) { | |
| if ( $username != $raw_username ) { | |
| $username = $raw_username; | |
| } | |
| $username = strip_tags( $username ); | |
| // Kill Chinese characters | |
| $username = preg_replace( '|[^a-z0-9 _.\-@一-龥]|ui', '', $username ); | |
| // Consolidate contiguous whitespace |
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
| // Create a new object for custom validation of a custom field. | |
| var nameSpaceController = Marionette.Object.extend( { | |
| initialize: function() { | |
| this.listenTo( nfRadio.channel( 'form' ), 'render:view', this.doCustomStuff ); | |
| }, | |
| doCustomStuff: function( view ) { | |
| var formModel = view.model; // formModel will be a Backbone model with all of our form data. | |
| var formID = formModel.get( 'id' ); // We can use .get( 'setting' ) get get any of our form settings. |
This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12
- Installing Homebrew is effortless, open Terminal and enter :
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" - Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.
At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :
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 //* Mind this opening PHP tag | |
| // Remove the logout link in comment form | |
| add_filter( 'comment_form_logged_in', '__return_empty_string' ); |
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
| #!/bin/bash | |
| cd wordpress-site | |
| cat >> docker-compose.yml <<EOL | |
| my-wpcli: | |
| image: tatemz/wp-cli | |
| volumes_from: | |
| - my-wp | |
| links: |
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
| #!/bin/bash | |
| mkdir wordpress-site && cd wordpress-site | |
| touch docker-compose.yml | |
| cat > docker-compose.yml <<EOL | |
| version: "2" | |
| services: | |
| my-wpdb: |
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
| // 使用 userAgent 判断是否微信内置浏览器 | |
| if( navigator.userAgent.toLowerCase().indexOf('micromessenger') > -1 || typeof navgator.wxuserAgent !== "undefined" ) { | |
| return true; | |
| } |