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
| mysql -u root -p |
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 | |
| APIKEY="SPOTIFY-API-KEY" | |
| trap onexit INT | |
| function reset() { | |
| echo 'Resetting status' | |
| curl -s -d "payload=$json" "https://slack.com/api/users.profile.set?token="$APIKEY"&profile=%7B%22status_text%22%3A%22%22%2C%22status_emoji%22%3A%22%22%7D" > /dev/null | |
| } |
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 | |
| let upSeconds="$(/usr/bin/cut -d. -f1 /proc/uptime)" | |
| let secs=$((${upSeconds}%60)) | |
| let mins=$((${upSeconds}/60%60)) | |
| let hours=$((${upSeconds}/3600%24)) | |
| let days=$((${upSeconds}/86400)) | |
| UPTIME=`printf "%d days, %02dh%02dm%02ds" "$days" "$hours" "$mins" "$secs"` | |
| # get the load averages | |
| read one five fifteen rest < /proc/loadavg |
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 | |
| $terms = get_the_terms( $post->ID, 'product_cat' ); | |
| foreach ( $terms as $term ){ | |
| $category_name = $term->name; | |
| $category_thumbnail = get_woocommerce_term_meta($term->term_id, 'thumbnail_id', true); | |
| $image = wp_get_attachment_url($category_thumbnail); | |
| echo '<img src="' . $image . '" alt="' . $term->name . '" />'; | |
| } | |
| ?> |
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
| <!-- Find Facebook ID on https://findmyfbid.com --> | |
| <!-- Fanpage --> | |
| <a href="fb://page/facebook_id">Launch Facebook App</a> | |
| <!-- Profile --> | |
| <a href="fb://profile/facebook_id">Launch Facebook App</a> |
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 | |
| $args = array( | |
| 'post_parent' => $post->ID, | |
| 'post_type' => 'page', | |
| 'orderby' => 'menu_order' | |
| ); | |
| $child_query = new WP_Query( $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
| //CPF | |
| $("input.cpf").mask("999.999.999-99"); | |
| //Data Nascimento | |
| $("input.nascimento").mask("99/99/9999"); | |
| //CEP | |
| $("input.cep").mask("99999-999"); | |
| //Telefone |
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 | |
| if(empty($alt_text)) // If not, Use the Caption | |
| { | |
| $attachment = get_post($post->ID); | |
| $alt_text = trim(strip_tags( $attachment->post_excerpt )); | |
| } | |
| if(empty($alt_text)) // Finally, use the title | |
| { | |
| $attachment = get_post($post->ID); | |
| $alt_text = trim(strip_tags( $attachment->post_title )); |
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 _remove_script_version( $src ){ | |
| $parts = explode( '?ver', $src ); | |
| return $parts[0]; | |
| } | |
| add_filter( 'script_loader_src', '_remove_script_version', 15, 1 ); | |
| add_filter( 'style_loader_src', '_remove_script_version', 15, 1 ); | |
| ?> |
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
| // install WordPress | |
| wp core download --locale=pt_BR | |
| // configuration wp-config.php | |
| wp core config --dbname=testecli --dbuser=root --dbpass=root --dbprefix=wp_ --locale=pt_BR | |
| // generate database | |
| wp db create | |
| // install WordPress |
NewerOlder