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.

(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 / 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]
@piotrekkaminski
piotrekkaminski / PR38.patch
Last active December 1, 2017 20:59
PR38 - Jan14 hackathon
From 3fdfd8454165c89d002da943e79d7aff9c1f560d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jose=CC=81=20Manuel=20Marti=CC=81nez=20Garci=CC=81a?=
<jose@theagilemonkeys.com>
Date: Thu, 20 Feb 2014 00:05:06 +0000
Subject: [PATCH] The fields taxvat and email have been added to
shoppingCartCustomerEntity and shoppingCartCustomerAddressEntity
respectively, inside SOAP API files for Checkout
---
app/code/core/Mage/Checkout/etc/wsdl.xml | 2 ++
#!/bin/bash
docker-compose exec --user magento2 web bash -c "cd /var/www/magento2 ; $*"
@piotrekkaminski
piotrekkaminski / mperf-7817.patch
Created March 3, 2017 16:16
MPERF-7817: First static block cached is always shown
From 58721d4cfd3ac47617af97f2670b54398f3e886f Mon Sep 17 00:00:00 2001
From: Mykola Palamar <mpalamar@ebay.com>
Date: Fri, 10 Jul 2015 19:30:25 +0300
Subject: [PATCH] Fixed MPERF-7464: CMS static block loads content of another
block saved to blocks HTML output cache
---
app/code/core/Mage/Cms/Block/Block.php | 20 ++++++++++++++++++++
app/code/core/Mage/Cms/Block/Widget/Block.php | 16 ++++++++++++++++
2 files changed, 36 insertions(+)