Posts

The Brachistochrone Problem

Image
 

Buoyancy, Relativity and Gravity

Image
Personal theory in comment.

Errors in Google's Rich Results Examples and Documentation

Image
1. The example given for  Subscription and paywalled content says "1 valid item with warnings detected" when tested on Google's own Testing Tool . When the @type is changed from "NewsArticle" to "WebPage" , which is one of the Supported types , the Testing Tool says "No rich results detected" .  2. The example given for Fact Check , when tested similarly, says "2 valid items detected: All have warnings" . The warning is Missing Field (firstAppearance) . Update (~May 2022) The documentation for appearance and firstAppearance under Fact Check says URL or CreativeWork . Fact Check s with URL s for appearance and firstAppearance, that have been showing as valid on the Testing Tool for months, are now showing Structured Data Warnings on Search Console . They continue to show as valid on the Testing Tool . Update (Jun 2022) Fact Check s with URL s for appearance and firstAppearance , which used to show no errors ...

Change Transient Hostname

There are three 3 types of hostnames: static pretty transient   Check what your current hostname is: hostnamectl The transient hostname comes from the reverse DNS. To change: sudo reboot This should fix the name in Undelivered Mails : "This is the mail system at host xxx"

PayPal Checkout Setup

PayPal's original checkout customization can be hard to find because of the two different sets of UI - new and old. Here's the link to the original checkout setup page . The way to get there through the new UI is using the PayPal buttons link.

Drupal Commerce Update License

 <?   // update commerce_license set expires = expires + 15552000 where license_id =  2050; $license_id = 0; $expires = 0; $incr_ts = 0; if (isset( $_GET['license_id'])) $license_id = $_GET['license_id']; if (isset( $_GET['expires'])) $expires = $_GET['expires']; if (isset( $_GET['incr_ts'])) $incr_ts = $_GET['incr_ts']; $num_updated = 0; // To prevent accidental reruns if (($license_id > 0) && ($expires > 0)) {     $num_updated = db_update('commerce_license')     ->expression('expires', 'expires + :incr_ts', array(':incr_ts' => $incr_ts))     ->condition('license_id', $license_id)     ->condition('expires', $expires)     ->execute(); } else if (($license_id > 0) && ($expires == 0)) { $expires = db_select("commerce_license", "cl")   ->fields("cl", array("expires"))     ->condition('license_id', $...

Drupal Delete Spam Accounts

 <? // Since when did mysql start supporting subqueries $result = db_query('select uid from users where uid not in ( 7077,8842,8304,8558,3975,5756 ) and uid not in ( select distinct uid from node ) and uid not in ( select distinct uid from comment ) and uid not in ( select distinct uid from users where picture > 0 ) and uid not in ( select distinct uid from profile_value ) and uid not in ( select distinct uid from commerce_order ) and uid not in ( select distinct entity_id from field_data_field_stock_watchlist )'); foreach ($result as $record)    if ($record->uid > 6) user_delete($record->uid); ?>