Skip to content

Instantly share code, notes, and snippets.

var pttable = $( '.dataTable' ).dataTable().api();
$('.posts-table-controls').first().append(
'<div class="datepicker-datatables" id="date_filter">' +
'<span id="date-label-from" class="date-label">Dal: </span><input class="date_range_filter date" type="text" id="datepicker_from" />' +
'<span id="date-label-to" class="date-label">Al: <input class="date_range_filter date" type="text" id="datepicker_to" />' +
'</div>'
);
$.fn.dataTable.ext.search.push(
function (settings, data, dataIndex) {
@bUxEE
bUxEE / woo_checkout_validation.js
Last active July 10, 2018 20:23
Woocommerce checkout validation with, mapbox autocmplete for address. must include mapbox sdk from cdn and jqueryvalidate
var mapboxEngine = new MapboxClient('MAPBOX_KEY');
function wopecko_validations() {
var $this = this;
this.init = function() {
this.rules();
this.checkout_validator();
this.find_address("#billing_address_1");
/**
* Extra emails wc
*/
class wopeckoStatusEmails {
function __construct($id,$title,$description) {
$this->ID = $id;
$this->title = $title;
$this->description = $description;
@bUxEE
bUxEE / encrypt-decrypt.php
Created October 12, 2018 13:49
encrypt decrypt
function cookie_decrypt_tool() {
$encrypted_payload = urldecode($_POST["content"]);
$encrypted_payload = substr( $encrypted_payload, 0, 3 ) === "%0A" ? substr($encrypted_payload, 3) : $encrypted_payload;
if (in_array("aes-128-cbc", openssl_get_cipher_methods())) {
$c = base64_decode($encrypted_payload);
$ivlen = openssl_cipher_iv_length('aes-128-cbc');
$iv = substr($c, 0, $ivlen);
$hmac = substr($c, $ivlen, $sha2len=32);
$ciphertext_raw = substr($c, $ivlen+$sha2len);
$original_plaintext = openssl_decrypt($ciphertext_raw, 'aes-128-cbc', KEY_CRIPTAZIONE_COOKIE_CUSTOMER_JOURNEY, $options=OPENSSL_RAW_DATA, $iv);
@bUxEE
bUxEE / monthly.css
Last active November 27, 2018 21:16
/* Overall wrapper */
.monthly {
background: #F3F3F5;
color: #545454;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
position: relative;