This file contains 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
pragma solidity ^0.4.19; | |
contract ERC20Basic { | |
string public constant name = "ERC20Basic"; | |
string public constant symbol = "BSC"; | |
uint8 public constant decimals = 18; | |
event Approval(address indexed tokenOwner, address indexed spender, uint tokens); |
This file contains 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
pragma solidity ^0.4.24; | |
// ---------------------------------------------------------------------------- | |
// Sample token contract | |
// | |
// Symbol : LCST | |
// Name : LCS Token | |
// Total supply : 100000 | |
// Decimals : 2 | |
// Owner Account : 0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe |
This file contains 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
#### IMAGE PROTECTION #### | |
#protect images from hotlinking | |
RewriteEngine on | |
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?domainname.com [NC] | |
RewriteRule \.(jpg|jpeg|png|gif|bmp|tiff|svg)$ - [NC,F,L] | |
#protect images from hotlinking send new image | |
RewriteEngine on | |
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?domainname.com [NC] |
This file contains 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
/** | |
* This code should be added to functions.php of your theme | |
**/ | |
add_filter('woocommerce_default_catalog_orderby', 'custom_default_catalog_orderby'); | |
function custom_default_catalog_orderby() { | |
return 'date'; // Can also use title and price | |
} | |
This file contains 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
add_filter('wp_get_attachment_image_attributes', 'change_attachement_image_attributes', 20, 2); | |
function change_attachement_image_attributes( $attr, $attachment ){ | |
// Get post parent | |
$parent = get_post_field( 'post_parent', $attachment); | |
// Get post type to check if it's product | |
$type = get_post_field( 'post_type', $parent); | |
if( $type != 'product' ){ | |
return $attr; |
This file contains 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 TABLE IF NOT EXISTS `country` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`iso` char(2) NOT NULL, | |
`name` varchar(80) NOT NULL, | |
`nicename` varchar(80) NOT NULL, | |
`iso3` char(3) DEFAULT NULL, | |
`numcode` smallint(6) DEFAULT NULL, | |
`phonecode` int(5) NOT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=MyISAM DEFAULT CHARSET=latin1; |
This file contains 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 custom_wcaf_fee_amount_subtotal( $subtotal ) { | |
$subtotal = 0; | |
$category_id = '61'; // Your category ID here. | |
$cart_items = WC()->cart->get_cart(); | |
foreach ( $cart_items as $key => $item ) { |
This file contains 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(function() { |