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
| .container { | |
| max-width: 1200px; | |
| margin: 0 auto; | |
| padding: 0 15px; | |
| width: 100% | |
| } | |
| .row { | |
| display: -webkit-box; | |
| display: -ms-flexbox; |
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
| @mixin for-phone-only { | |
| @media (max-width: 599px) { @content; } | |
| } | |
| @mixin for-tablet-portrait-up { | |
| @media (min-width: 600px) { @content; } | |
| } | |
| @mixin for-tablet-landscape-up { | |
| @media (min-width: 900px) { @content; } | |
| } | |
| @mixin for-desktop-up { |
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
| // vanilla JavaScript | |
| var links = document.links; | |
| for (var i = 0, linksLength = links.length; i < linksLength; i++) { | |
| if (links[i].hostname != window.location.hostname) { | |
| links[i].target = '_blank'; | |
| } | |
| } | |
| // or in jQuery |
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 | |
| /* WooCommerce emails for cancelled pending orders */ | |
| add_action('woocommerce_order_status_pending_to_cancelled', 'pending_cancelled_send_an_email_notification', 10, 2 ); | |
| function pending_cancelled_send_an_email_notification( $order_id, $order ) { | |
| if ( version_compare( WC_VERSION, '3.0.8', '>=' ) ) { | |
| // Getting all WC_emails objects | |
| $email_notifications = WC()->mailer()->get_emails(); | |
| // Sending the email | |
| $email_notifications['WC_Email_Cancelled_Order']->trigger( $order_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 | |
| /** | |
| * Template Name: ajax | |
| */ | |
| ?> | |
| <?php | |
| $post = get_post($_GET['id']); | |
| ?> | |
| <?php if ($post) : ?> | |
| <?php setup_postdata($post); ?> |
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
| /* | |
| Hoje iremos MUDAR a vida da pessoa que não te responde no Facebook... | |
| Que tal enviar mensagens pra ela até obter uma resposta?! | |
| Sensacional não acha?! Mas, somos devs, correto?! Então vamos automatizar esse paranauê! | |
| Para utilizar: | |
| - Abra o messenger.com; | |
| - Selecione a conversa que você quer; | |
| - Abra o console e cole o código que está no gist; |
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( 'wp_enqueue_scripts', 'child_load_google_fonts' ); | |
| /** | |
| * Enqueue Google Fonts using a function | |
| */ | |
| function child_load_google_fonts() { | |
| // Setup font arguments | |
| $query_args = array( |
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 fetchJSON( $post_id ) { | |
| // Just for demo purpose, it's possible to fetch and pass data | |
| $content = get_post_field('post_content', $post_id); | |
| // open file | |
| $open = curl_init(); | |
| curl_setopt($open, CURLOPT_URL, "https://mydomain.com/path/getContent.php?content=".$content); | |
| curl_exec($open); | |
| } |
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 retry(isDone, next) { | |
| var current_trial = 0, max_retry = 50, interval = 10, is_timeout = false; | |
| var id = window.setInterval( | |
| function() { | |
| if (isDone()) { | |
| window.clearInterval(id); | |
| next(is_timeout); | |
| } | |
| if (current_trial++ > max_retry) { | |
| window.clearInterval(id); |