Skip to content

Instantly share code, notes, and snippets.

{
"short_name": "Share url to Linkace",
"name": "Share url to Linkace",
"share_target": {
"action": "/public/bookmarklet/addmobile",
"method": "GET",
"params": {
"title": "t",
"text": "u"
}
<?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;
@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.
#
@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 / 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 / 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 / wc-sample-products-loop.php
Created November 24, 2021 08:11 — forked from woogists/wc-sample-products-loop.php
[Theming Snippets] Sample products loop
<ul class="products">
<?php
$args = array(
'post_type' => 'product',
'posts_per_page' => 12
);
$loop = new WP_Query( $args );
if ( $loop->have_posts() ) {
while ( $loop->have_posts() ) : $loop->the_post();
wc_get_template_part( 'content', 'product' );
@kanlukasz
kanlukasz / .gitignore
Created October 25, 2021 08:46 — forked from lukecav/.gitignore
WordPress - GitHub Repo .gitignore example
# -----------------------------------------------------------------
#
# By default all files are ignored. You'll need to whitelist
# any mu-plugins, plugins, or themes you want to include in the repo.
#
# To ignore uncommitted changes in a file that is already tracked, use
# git update-index --assume-unchanged
#
# To stop tracking a file that is currently tracked, use
# git rm --cached
@kanlukasz
kanlukasz / myscript.sh
Created October 5, 2021 06:49 — forked from bradtraversy/myscript.sh
Basic Shell Scripting
#! /bin/bash
# ECHO COMMAND
# echo Hello World!
# VARIABLES
# Uppercase by convention
# Letters, numbers, underscores
NAME="Bob"
# echo "My name is $NAME"
@kanlukasz
kanlukasz / serve-side-block.js
Created September 17, 2021 07:46 — forked from Shelob9/serve-side-block.js
Example Gutenberg block with server-side rendering. Gutenberg edit() block creates interface. Gutenberg saves settings automatically, the PHP function passed as `render_callback` to `register_block_type` is used to create HTML for front-end rendering of block.
const { __ } = wp.i18n;
const { registerBlockType } = wp.blocks;
const el = wp.element.createElement;
registerBlockType( 'hiRoy/serverSide', {
title: __( 'Server Side Block', 'text-domain' ),
icon: 'networking',
category: 'common',
attributes: {