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 | |
//Checks if the "Disable Add to Cart" variable is set to 'Yes': | |
if(($_product->getAttributeText('no_sample_button')) == "Yes"){ | |
//If set to Yes, tell PHP what to output: | |
} else { | |
?> |
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 | |
/** | |
Example of use: | |
$bl_check = new Fb_Backlink_Checker( 'http://www.example.com', 'http://other.com' ); | |
$bl_check->get_contents(); | |
$bl_check->fetch_links(); | |
if ( TRUE !== $bl_check->check() ) { | |
echo 'Backlink not found.'; |
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( 'woocommerce_cart_item_price', 'bbloomer_change_cart_table_price_display', 30, 3 ); | |
function bbloomer_change_cart_table_price_display( $price, $values, $cart_item_key ) { | |
$slashed_price = $values['data']->get_price_html(); | |
$is_on_sale = $values['data']->is_on_sale(); | |
if ( $is_on_sale ) { | |
$price = $slashed_price; | |
} | |
return $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
class FLHM_HTML_Compression{ | |
protected $flhm_compress_css = true; | |
protected $flhm_compress_js = true; | |
protected $flhm_info_comment = true; | |
protected $flhm_remove_comments = true; | |
protected $html; | |
public function __construct($html){ | |
if (!empty($html)){ | |
$this->flhm_parseHTML($html); | |
} |
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
#!/bin/bash | |
FILES=*.flac | |
for f in $FILES | |
do | |
echo $f | |
ffmpeg -i "$f" "${f%%.*}.mp3" | |
done |
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
#!/usr/bin/python | |
# Ratings Scraper | |
# Watches the house price on screetons. | |
from bs4 import BeautifulSoup | |
from datetime import datetime | |
import requests | |
import re |
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
#!/usr/bin/python | |
import os | |
import urllib | |
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
from selenium.webdriver.chrome.options import Options | |
chrome_options = Options() | |
chrome_options.add_argument("--headless") |
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 | |
$curl = curl_init(); | |
$ApiKey = "<APIKEY>"; | |
$postedcarreg = '<CARREG>'; | |
$carreg = $postedcarreg; | |
$datatype = "VehicleData"; | |
$url = "https://uk1.ukvehicledata.co.uk/api/datapackage/%s?v=2&api_nullitems=1&key_vrm=%s&auth_apikey=%s"; | |
$url = sprintf($url, $datatype , $carreg, $ApiKey); // Syntax: sprintf($url, "PackageName", "VRM", ApiKey); | |
curl_setopt_array($curl, array( | |
CURLOPT_URL => $url, |
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
function testimonial_post_type() { | |
// Labels | |
$labels = array( | |
'name' => _x("Testimonials", "post type general name"), | |
'singular_name' => _x("Testimonial", "post type singular name"), | |
'menu_name' => 'Testimonials', | |
'add_new' => _x("Add New", "testimonial item"), | |
'add_new_item' => __("Add New Testimonial"), | |
'edit_item' => __("Edit Testimonial"), |
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
RewriteEngine On | |
RewriteCond %{HTTPS} !=on | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE] | |
Header always set Content-Security-Policy "upgrade-insecure-requests;" | |
RewriteRule ^page-1$ page.php?area=1 | |
RewriteRule ^page-2$ page.php?area=1 |
OlderNewer