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 | |
#Simple script for importing data from bitly to yourls using bitly and yourls API. | |
import urllib2, json, urllib | |
#Add the following data | |
yourls_host = 'your-domain-where-yours-is-installed.com' | |
bitly_token = 'your-bitly-token' | |
yourls_signature = 'your-yourls-signature-key' |
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
/** | |
* Set the Slug attribute and add counter if not unique. | |
* This function will check if the current model's slug is unique and update | |
* if with a counter at the end of the slug (such as -2) if there already exists. | |
* For example, if we're saving a page called "About us" with the slug | |
* "about-us", but for some reason you already have a page with the slug | |
* "about-us" this new page would then be set to have the slug | |
* "about-us-2" instead. | |
* | |
* @param any $value This is the value passed to this setting function. |
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
on adding folder items to this_folder after receiving added_items | |
try | |
repeat with nDec from 0 to 255 | |
set nHex to do shell script "perl -e 'printf(\"FFFFFF%x\", " & nDec & ")'" | |
do shell script "echo " & nHex & " > /tmp/ckbpipe001" | |
delay 0.005 | |
end repeat | |
delay 0.1 | |
repeat with nDec from 0 to 255 | |
set nHex to do shell script "perl -e 'printf(\"FFFFFF%x\", " & 255 - nDec & ")'" |
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
{% if first_time_accessed %} | |
<script> | |
fbq('track', 'Purchase', { | |
contents: [ | |
{% for line_item in line_items %} | |
{ | |
'id': '{{ line_item.sku }}', | |
'quantity': {{ line_item.quantity }}, | |
'item_price': {{ line_item.line_price | money_without_currency }} | |
}, |
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
{ | |
"_media": { | |
"prefix": "_media", | |
"body": [ | |
"/* Large Devices, Wide Screens */", | |
"@media only screen and (max-width : 1200px) {}", | |
"/* Medium Devices, Desktops */", | |
"@media only screen and (max-width : 992px) {}", | |
"/* Small Devices, Tablets */", | |
"@media only screen and (max-width : 768px) {}", |
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 $filterreset = $_SERVER['REQUEST_URI']; | |
if ( strpos($filterreset,'?filter_') !== false | strpos($filterreset,'?min_price') !== false | strpos($filterreset,'?max_price')) { | |
$filterreset = strtok($filterreset, '?'); | |
echo '<div class="clear-filters-container"><a id="woo-clear-filters" href="'.$filterreset.'">Clear All Filters</a></div>'; | |
} |
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
/** | |
* Select Stripe as default payment gateway | |
*/ | |
add_action( 'woocommerce_before_checkout_form', 'set_default_gateway' ); | |
function set_default_gateway(){ | |
// HERE define the default payment gateway ID | |
$default_payment_gateway_id = 'stripe'; | |
WC()->session->set('chosen_payment_method', $default_payment_gateway_id); | |
} |
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
/* | |
* Pick and chose which payment icons you'd want to show on the checkout page | |
* next to he payment gateways. The default in this function is to hide them all. | |
* Primarily made for stripe | |
*/ | |
add_filter( 'wc_stripe_payment_icons', 'show_hide_woocommerce_gateway_payment_icons' ); | |
function show_hide_woocommerce_gateway_payment_icons( $icons ) { | |
$icon_list = [ | |
"visa", |
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
@mixin optional-at-root($sel) { | |
@at-root #{if(not &, $sel, selector-append(&, $sel))} { | |
@content; | |
} | |
} | |
@mixin placeholder { | |
@include optional-at-root('::-webkit-input-placeholder') { | |
@content; | |
} |
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_min_password_strength', 'example_woocommerce_min_password_strength' ); | |
/** | |
* Callback for WooCommerce 'woocommerce_min_password_strength' filter. | |
* | |
* Reduce the strength requirement on the woocommerce password. | |
* | |
* 0 = Anything (not a good idea) | |
* 1 = Weak | |
* 2 = Medium | |
* 3 = Strong (default) |
OlderNewer