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 hide_admin_bar() { | |
//could check user role here | |
return false; | |
} | |
add_filter( 'show_admin_bar', 'hide_admin_bar' ); |
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( 'woocommerce_single_product_summary', 'woocommerce_total_product_price', 31 ); | |
function woocommerce_total_product_price() { | |
global $woocommerce, $product; | |
// let's setup our divs | |
echo sprintf('<div id="product_total_price" style="margin-bottom:20px;display:none">%s %s</div>','Total do Produto','<span class="price">'.$product->get_price().'</span>'); | |
echo sprintf('<div id="cart_total_price" style="margin-bottom:20px;display:none">%s %s</div>','Total do Carrinho','<span class="price">'.$product->get_price().'</span>'); | |
?> | |
<script> | |
jQuery(function($){ |
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
package br.com.brgweb.splashtest; | |
import android.content.Intent; | |
import android.support.v7.app.ActionBar; | |
import android.support.v7.app.AppCompatActivity; | |
import android.os.Bundle; | |
import android.os.Handler; | |
public class SplashActivity extends AppCompatActivity { |
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
<style> | |
loader { | |
left: 50%; | |
top: 50%; | |
position: fixed; | |
-webkit-transform: translate(-50%, -50%); | |
transform: translate(-50%, -50%); } | |
.loader #spinner { | |
box-sizing: border-box; | |
stroke: #FB791A; |
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 | |
// This code is based in Mathew Horne blog post: https://matthewhorne.me/defer-async-wordpress-scripts/ | |
//function to add async attribute | |
function add_async_attribute($tag, $handle) { | |
$scripts_to_async = array('my-js-handle-async', 'another-handle-async'); | |
//check if this script is in the array | |
if (in_array($handle, $scripts_to_async)){ | |
//return with async | |
return str_replace(' src', ' async="async" src', $tag); |
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
<input type="number" step="1" min="1" max="999" maxlength="3" name="number" inputmode="numeric" oninput="javascript: if (this.value.length > this.maxLength) this.value = this.value.slice(0, this.maxLength);"> |
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 'dart:io'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/cupertino.dart'; | |
void main() => runApp(new MyApp()); | |
class MyApp extends StatelessWidget { | |
// This widget is the root of your application. | |
@override |
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
var fixed = false; | |
var sidebarTop = jQuery('#secondary').offset().top; | |
var sidebarHeight = jQuery('#secondary').height(); | |
var windowHeight = jQuery(window).height(); | |
var leftHeight = jQuery('.left-content-area').height(); | |
if (windowHeight < sidebarHeight){ | |
startPosition = sidebarTop + sidebarHeight - windowHeight; | |
fixPosition = windowHeight - sidebarHeight; | |
endPosition = leftHeight + sidebarTop - windowHeight; | |
}else{ |
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
jQuery(document).ready(function($){ | |
$(":checkbox").click(function(){ | |
let isChecked = $(this).prop('checked'); | |
let id = $(this)[0].id; | |
let itemClasses = $(this).attr('class'); | |
if (id != undefined && id != ""){ | |
$("."+id).prop('checked',isChecked); | |
} | |
if (!isChecked){ | |
if (itemClasses != undefined){ |
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
--------- beginning of main | |
04-02 11:02:32.310 5549 7959 I PTCommittedOperation: Receive new configuration for com.google.android.gms.magictether | |
04-02 11:02:32.341 5549 7679 E MagicTether: [MagicTetherInitializer] Invalid account list. | |
04-02 11:02:32.398 5581 7947 W ModuleInitIntentOp: Dropping unexpected action com.google.android.gms.phenotype.COMMITTED | |
04-02 11:02:32.402 5549 8068 I PTCommittedOperation: Receive new configuration for com.google.android.metrics | |
04-02 11:02:32.438 5549 7170 E MagicTether: [TetherListenerService] Invalid account list. | |
04-02 11:02:32.511 5581 7946 W ModuleInitIntentOp: Dropping unexpected action com.google.android.gms.phenotype.COMMITTED | |
04-02 11:02:32.518 5549 8068 I PTCommittedOperation: Receive new configuration for com.google.android.gms.walletp2p#config | |
04-02 11:02:32.598 5581 8028 W ModuleInitIntentOp: Dropping unexpected action com.google.android.gms.phenotype.COMMITTED | |
04-02 11:02:32.648 5549 8228 I PTCommittedOperation: Receive new configuration for |