Skip to content

Instantly share code, notes, and snippets.

@kanlukasz
kanlukasz / pretty_thunderbird_labels.css
Created August 1, 2022 16:13 — forked from eriwen/pretty_thunderbird_labels.css
userChrome.css snippet for Thunderbird to have pretty labels
/* Default Important Label */
treechildren::-moz-tree-cell(lc-FF0000) {
border-bottom: 1px solid #FF0000 !important; background-color: #FFCCCC !important;
}
treechildren::-moz-tree-cell-text(lc-FF0000) {
color: #000000 !important;
}
treechildren::-moz-tree-cell(lc-FF0000, selected) {
background-color: #FF0000 !important;
}
@kanlukasz
kanlukasz / manage_edit-product_columns.php
Created August 30, 2022 07:24 — forked from runezero/manage_edit-product_columns.php
[Admin products sort by date] Adds the modified date to the Admin product column and gives the option to sort products by date modified #woocommerce
add_filter( 'manage_edit-product_columns', 'admin_products_sort_modified', 9999 );
function admin_products_sort_modified( $columns ){
$columns['laatst_bijgewerkt'] = 'Laatst bijgewerkt';
return $columns;
}
add_action( 'manage_product_posts_custom_column', 'admin_products_sort_modified_content', 10, 2 );
function admin_products_sort_modified_content( $column, $product_id ){
if ( $column == 'laatst_bijgewerkt' ) {
//echo strtotime(get_the_modified_date("Y-m-d H:i:s", $product_id));
@kanlukasz
kanlukasz / updatestockprice.md
Created January 30, 2023 06:39 — forked from KittenCodes/updatestockprice.md
Update WooCommerce Price & Stock levels with WP All Import

Update WooCommerce price & stock levels with WP All Import

You will need an import file that contains the new stock value, price information and the variation SKU. For this process to work correctly, your products will need to have unique SKUs.

  1. Create an "Existing Items" import to WooCommerce Products: https://d.pr/i/c5daMc
  2. On Step 3 of the import process, leave the Product Type set to Simple, add the new price information to the General tab (https://d.pr/i/P6XQhC) and the new stock value to the Inventory tab: https://d.pr/i/iN9S5t
  3. On Step 4 of the import process, select to match on the custom field _sku and add the SKU element from your import file: https://d.pr/i/7EwWTl
  4. Also on Step 4, select to update the custom fields _price, _regular_price, _sale_price, _stock and _manage_stock only: https://d.pr/i/c1iZm7
@kanlukasz
kanlukasz / ssh-exit-codes.sh
Created March 28, 2022 05:39 — forked from asiegman/ssh-exit-codes.sh
Understanding SSH and exit codes in Bash scripts.
#!/bin/bash
#
# SSH Exit Codes
#
# Using SSH in scripting is pretty standard, but sometimes you want to stop execution of a script
# if a command inside an SSH session fails to exit cleanly (return 0). The key to remember is that
# the ssh command's exit code will be that of the *last executed* command inside the ssh session, just
# like a bash script ends with the exit code of the last command executed unless you specifically
# call exit.
#
<?php
namespace App\Http\Controllers\App;
use App\Http\Controllers\Controller;
use App\Models\Link;
use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\View\View;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
{
"short_name": "Share url to Linkace",
"name": "Share url to Linkace",
"share_target": {
"action": "/public/bookmarklet/addmobile",
"method": "GET",
"params": {
"title": "t",
"text": "u"
}