Skip to content

Instantly share code, notes, and snippets.

@strarsis
strarsis / gist:b989ac83b4c1cb11927820627fb6079a
Created March 31, 2022 20:58
WordPress Activity Log Plugin error after update
[Unknown column 'client_ip' in 'field list']
REPLACE INTO `wp_wsal_occurrences` (`site_id`, `alert_id`, `created_on`, `client_ip`, `severity`, `object`, `event_type`, `user_agent`, `user_roles`, `username`, `user_id`, `session_id`, `post_status`, `post_type`, `post_id`) VALUES (1, 2101, '1648760092.973838', '', '', '', '', '', '', NULL, NULL, '', '', '', 0)
@strarsis
strarsis / log
Created March 24, 2022 20:25
WooCommerce Update Thank You page white screen/PHP error
PHP message: WordPress database error Unknown column 'is_read' in 'field list' for query UPDATE `wp_wc_admin_notes` SET `name` = 'wc-admin-optimizing-the-checkout-flow', `type` = 'info', `locale` = 'en_US', `title` = 'Optimizing the checkout flow', `content` = 'It’s crucial to get your store’s checkout as smooth as possible to avoid losing sales. Let’s take a look at how you can optimize the checkout experience for your shoppers.', `content_data` = '{}', `status` = 'pending', `source` = 'woocommerce.com', `date_created` = '2021-02-03 19:00:04', `date_reminder` = NULL, `is_snoozable` = '0', `layout` = 'plain', `image` = '', `is_deleted` = '', `is_read` = '' WHERE `note_id` = '41' made by require('wp-blog-header.php'), require_once('wp-load.php'), require_once('[...]/wp-config.php'), require_once('wp-settings.php'), do_action('init'), WP_Hook->do_action, WP_Hook->apply_filters, Automattic\WooCommerce\Admin\Install::check_version, do_actio...PH
function Child({ onClick }) {
return <button onClick={onClick} type="button">Child Button</button>;
}
export default function Parent() {
const onClick = () => {
console.log('I\'m in the parent, but the child was clicked');
};
return (
@strarsis
strarsis / .bashrc
Created March 16, 2018 18:02
Vagrant on WSL (Bash on Windows)
# Vagrant
export VAGRANT_WSL_ENABLE_WINDOWS_ACCESS="1"
export PATH=$PATH:/mnt/c/Program\ Files/Oracle/VirtualBox
export VAGRANT_WSL_WINDOWS_ACCESS_USER_HOME_PATH="/mnt/c/Users/<Windows Username>"
@strarsis
strarsis / hint.md
Last active March 5, 2022 19:58
Make TypeScript ignore all other directories than e.g. `src/`

TypeScript can have issues with with more folders containing TypeScript files than just the one used as rootDir, (e.g. migrations/ for Knex). (E.g. see this now archived/locked issue microsoft/TypeScript#9858).

The exclude option in tsconfig.json won't prevent this issue. Instead use the include option and include only the rootDir folder.

Example (showing only the relevant fields):

{
  "compilerOptions": {
@strarsis
strarsis / IonItemSlidingBack.js
Last active February 20, 2022 22:58
`<IonItemSliding>` `onIonDrag` event handler `this` example
import {
IonItemSliding,
} from '@ionic/react';
type IonItemSlidingBackProps = {
children?: React.ReactNode;
};
const IonItemSlidingBack: React.FC<IonItemSlidingBackProps> = ({ children }) => {
return (
https://gist.githubusercontent.com/strarsis/bc73301306416a569cdcf4a9649ea97b/raw/9f6b6f113df2bff53a5fe28989401513f5f22d54/mask-middle-border-variable-radius-scaling.svg
@strarsis
strarsis / PHP Fatal error stack trace
Created January 29, 2022 16:26
`PublishPress Authors Pro` + `WP Activity Log` PHP Fatal error stack trace
( ! ) Fatal error: Uncaught Error: Xdebug has detected a possible infinite loop, and aborted your script with a stack depth of '9000' frames in /srv/www/web/wp/wp-includes/option.php on line 80
( ! ) Error: Xdebug has detected a possible infinite loop, and aborted your script with a stack depth of '9000' frames in /srv/www/web/wp/wp-includes/option.php on line 80
Call Stack
# Time Memory Function Location
1 0.0001 378304 {main}( ) .../edit.php:0
2 0.4161 8432504 WP_Posts_List_Table->display( ) .../edit.php:477
3 0.4208 8441288 WP_Posts_List_Table->display_rows_or_placeholder( ) .../class-wp-list-table.php:1289
4 0.4208 8441288 WP_Posts_List_Table->display_rows( $posts = ???, $level = ??? ) .../class-wp-list-table.php:1362
5 0.4208 8441664 WP_Posts_List_Table->_display_rows_hierarchical( $pages = [0 => class stdClass { public $ID = 229; public $post_parent = 0 }, 1 => class stdClass { public $ID = 1264; public $post_parent = 0 }, 2 => class stdClass { public $ID = 232; public $post_parent = 0 }, 3 => class std
@strarsis
strarsis / iframe-content.html
Created July 28, 2021 17:11
Disappearing element with perspective/transform: perspective issue (Chrome) (iframe content)
<!DOCTYPE html>
<html lang="en">
<head>
<style>
/* Pannellum hotspot element */
.hotspot {
width: 24px;
height: 24px;
background: red;
transform: translate(100px, 150px) translateZ(9999px);
@strarsis
strarsis / note-disabled-pmkid-wifi-issue.md
Last active July 13, 2021 21:22
Windows 10 WiFi disconnection after about a minute (disabled PMKID)

If the WiFi connection disconnects after about a minute (or less) on Windows 10, one reason can be disabled PMKID. This WiFi feature can be disabled to improve security (as it can be exploited in some WiFi attacks in some specific scenarios), but it can also cause issues with some clients.

In this case a HP 250 G7 notebook disconnected after about or less than a minute from a Mikrotik RouterBOARD mAP 2n. The Disable PMKID feature was enabled in the security profile used by the wireless interface in question and disabling it fixed the issue immediately.

Note: (Wireless (sidebar) → Security Profile (tab) → open the used security profile (default) → disable the Disable PMKID checkbox at the bottom → OK)