Skip to content

Instantly share code, notes, and snippets.

View piotrekkaminski's full-sized avatar

Piotr Kaminski piotrekkaminski

View GitHub Profile
@piotrekkaminski
piotrekkaminski / SKILL.md
Created August 14, 2026 15:51
creative — a Claude/agent skill implementing Verbalized Sampling (arXiv:2510.01171). Generates 10 substantially different long-tail responses with explicit probability estimates.
name creative
description Generate 10 substantially different, long-tail responses to a question or task, each with an estimated probability under 0.10. Use when the user asks for creative thinking, a creative approach, "be creative", "think creatively", "give me creative options", "what are the unconventional angles", "sample the long tail", or otherwise signals that the obvious answer is not what they want. Applies to product and strategy ideation, reframing stuck problems, and finding fresh angles for writing. Do NOT use for routine execution, factual lookups, or when the user wants the single best conventional answer.

Creative

Sample the long tail. The user already knows the obvious answer. This skill exists to surface the answers that ordinary prompting would bury.

Based on Verbalized Sampling. See Attribution at the bottom.

@piotrekkaminski
piotrekkaminski / docker_beta.md
Last active July 2, 2025 00:06
Docker Beta Installation Info & FAQ
@piotrekkaminski
piotrekkaminski / gist:9bc45ec84028611d621e
Last active July 2, 2025 00:06
How to automatically download patches and release of Magento
1) First you need to generate download token. Login to your account on magento.com and generate it in Account Settings->Downloads Access Token
2) You will need your MAGEID as well. It is shown at the top-left in your account page.
3) curl -k https://MAGEID:TOKEN@www.magentocommerce.com/products/downloads/info/help
4) Profit!
(function() {
document.cookie = "username=John Doe";
alert("Setting cookie");
})();
@piotrekkaminski
piotrekkaminski / MPERF-10565.diff
Created April 8, 2019 18:04
MPERF-10565.diff - logging to a file that does not exist issue
diff --git a/app/Mage.php b/app/Mage.php
index 0e650eebb4f..9c18e222689 100644
--- a/app/Mage.php
+++ b/app/Mage.php
@@ -798,9 +798,9 @@ public static function log($message, $level = null, $file = '', $forceLog = fals
',',
(string) self::getConfig()->getNode('dev/log/allowedFileExtensions', Mage_Core_Model_Store::DEFAULT_CODE)
);
- $logValidator = new Zend_Validate_File_Extension($_allowedFileExtensions);
$logDir = self::getBaseDir('var') . DS . 'log';
@piotrekkaminski
piotrekkaminski / PATCH_SUPEE-389_EE_1.12.0.2_v2.sh
Created September 5, 2014 20:18
SUPEE-389: Every time the catalog URL is rendexed, a new custom rewrite is created
#!/bin/bash
# Patch apllying tool template
# v0.1.2
# (c) Copyright 2013. Magento Inc.
#
# DO NOT CHANGE ANY LINE IN THIS FILE.
# 1. Check required system tools
_check_installed_tools() {
local missed=""
@piotrekkaminski
piotrekkaminski / MPERF-10509.diff
Last active March 12, 2019 20:16
MPERF-10509.diff
diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php
index d402b7512dd..8f58e873b46 100644
--- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php
+++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php
@@ -19,7 +19,7 @@ class Mage_Adminhtml_Block_Dashboard_Graph extends Mage_Adminhtml_Block_Dashboar
/**
* Api URL
*/
- const API_URL = 'http://chart.apis.google.com/chart';
+ const API_URL = 'https://image-charts.com/chart';

Fixed a Redis configuration issue that incorrectly enabled session locking for Magento Commerce v2.1.11+ and v2.2.1+, which can cause slow performance and timeouts. Now, session locking is disabled by default. The issue was caused by a change in the default behavior of the disable_locking parameter introduced in v1.3.4 of the Redis session handler package, colinmollenhour/php-redis-session-abstract. Background:

In Magento 2.2.1+, 2.1.11+, 2.3.0+ colinmollenhour/php-redis-session-abstract composer dependency has been updated and as a result Redis setting "disable_locking" became disabled. It causes a lot of issues (list of customer tickets) To Do:

This setting should be enabled for all clients by default: in the php-redis-session-abstract-1.3.3 and earlier versions "disable_locking=1" means "use locking" (https://github.com/colinmollenhour/php-redis-session-abstract/blob/v1.3.3/src/Cm/RedisSession/Handler.php#L131) in the php-redis-session-abstract-1.3.4 and higher "disable_locking=1" means "do not use lo

@piotrekkaminski
piotrekkaminski / PATCH_SUPEE-11043_EE_1.14.4.0_v1.sh
Created December 4, 2018 16:03
PATCH_SUPEE-11043_EE_1.14.4.0_v1.sh
#!/bin/bash
# Patch apllying tool template
# v0.1.2
# (c) Copyright 2013. Magento Inc.
#
# DO NOT CHANGE ANY LINE IN THIS FILE.
# 1. Check required system tools
_check_installed_tools() {
local missed=""
@piotrekkaminski
piotrekkaminski / invalid_session_fix.patch
Created March 14, 2018 17:08
Revert guest checkout account registration problem introduced by patch SUPEE-10570. Note: this does not protect against security issues related to session lifetime.
diff --git a/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php b/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php
index 59b3ea8..35155f1 100644
--- a/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php
+++ b/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php
@@ -485,7 +485,7 @@ class Mage_Core_Model_Session_Abstract_Varien extends Varien_Object
&& isset($validatorData[self::VALIDATOR_PASSWORD_CREATE_TIMESTAMP])
&& isset($sessionData[self::VALIDATOR_SESSION_EXPIRE_TIMESTAMP])
&& $validatorData[self::VALIDATOR_PASSWORD_CREATE_TIMESTAMP]
- > $sessionData[self::VALIDATOR_SESSION_EXPIRE_TIMESTAMP] - $this->getCookie()->getLifetime()
+ > $sessionData[self::VALIDATOR_SESSION_EXPIRE_TIMESTAMP]