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
| # https://editorconfig.org | |
| root = true | |
| [*] | |
| indent_style = space | |
| indent_size = 2 | |
| end_of_line = lf | |
| charset = utf-8 | |
| trim_trailing_whitespace = true | |
| insert_final_newline = true |
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_action('rest_api_init', function () { | |
| register_rest_route( 'wp/v2', 'options', [ | |
| 'methods' => 'GET', | |
| 'callback' => 'api_theme_options' | |
| ]); | |
| }); | |
| function api_theme_options($request) { |
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_action('rest_api_init', function () { | |
| register_rest_route( 'contact/v1', 'send', [ | |
| 'methods' => 'POST', | |
| 'callback' => 'api_send_contact_form' | |
| ]); | |
| }); | |
| function api_send_contact_form( $request ) { |
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 theme_metabox_per_page() { | |
| global $pagenow; | |
| if ( $pagenow == 'post.php' ) { | |
| $page_id = ( $_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['post_ID'] ) ? $_POST['post_ID'] : $_GET['post']; | |
| if ( $page_id ) { | |
| $page_slug = get_post_field( 'post_name', $page_id ); |
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 get_custom_post_meta_cb($object, $field_name, $request) { | |
| return get_post_meta( $object['id'], $field_name, true ); | |
| } | |
| function get_custom_post_meta_cb_the_content($object, $field_name, $request) { | |
| return apply_filters( 'the_content', get_post_meta( $object['id'], $field_name, true ) ); | |
| } |
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
| import axios from 'axios' | |
| const isProduction = process.env.NODE_ENV === 'production' | |
| const http = axios.create({ | |
| baseURL: `${isProduction ? 'https://api' : 'http://api-dev'}.dominio.com.br`, | |
| headers: {} | |
| }) | |
| export default http |
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 | |
| SEARCH="passenger_ruby \/home\/ubuntu\/.rvm\/gems\/ruby-2.4.1\/wrappers\/ruby;" | |
| REPLACE="include snippets\/passenger_ruby.conf;" | |
| # Note the double quotes | |
| for file in ./sites-enabled/*; | |
| do | |
| sed -i -- "s/${SEARCH}/${REPLACE}/g" $file; | |
| echo $file; |
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
| sudo rm -rf /Library/Developer/CommandLineTools | |
| xcode-select --install |
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
| const faIcons = [ | |
| 'fa-500px', | |
| 'fa-address-book', | |
| 'fa-address-book-o', | |
| 'fa-address-card', | |
| 'fa-address-card-o', | |
| 'fa-adjust', | |
| 'fa-adn', | |
| 'fa-align-center', | |
| 'fa-align-justify', |
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
| /** | |
| * Returns a random number | |
| * | |
| * @param {Number} length | |
| * @return {Number} | |
| */ | |
| const randomNumber = length => | |
| Math.floor(Math.random() * length) |