Skip to content

Instantly share code, notes, and snippets.

View Leksat's full-sized avatar

Alexander Tkachev Leksat

View GitHub Profile
#!/usr/bin/env bash
set -euo pipefail
# Mirrors the session to a log to work around Claude Code TUI limitations:
# - inability to see full bash output (the ctrl+o expander is unreliable)
# - inability to see web search results (the TUI shows only the query)
# - inability to copy agent replies (/copy grabs too much; manual select drops formatting)
# - inability to copy user prompts (the TUI adds indent and newline artifacts)
log_file="${CLAUDE_LOG:-/tmp/claude.log}"
@Leksat
Leksat / 1-settings.json
Last active June 4, 2026 08:21
Force Claude Code to load a skill before running certain commands
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "~/.claude/hooks/git-gate.sh"
}
[
{
"provider_name": "YouTube",
"provider_url": "https://www.youtube.com/",
"endpoints": [
{
"schemes": [
"https://*.youtube.com/watch*",
"https://*.youtube.com/v/*",
"https://youtu.be/*"
@Leksat
Leksat / copy.js
Last active March 25, 2025 06:39
Copy bookmarklet for Jira
javascript:(function(){
const ticketNumber =
/* If we are on a Jira board. */
location.search.match('[?&]selectedIssue=(.*?)([&]|$)')?.[1] ||
/* If we are on the ticket page. */
location.pathname.split('/').pop();
const ticketSummary = document.querySelector('h1[data-testid*="summary.heading"]').textContent.trim();
const ticketUrl = `${location.origin}/browse/${ticketNumber}`;
const html = `<a href="${ticketUrl}">${ticketNumber} [${ticketSummary}]</a>`;
const text = `[${ticketNumber} ${ticketSummary}](${ticketUrl})`;
@Leksat
Leksat / README.md
Last active February 14, 2019 22:02 — forked from joyrexus/README.md
collapsible markdown
Clsfgy dftyylll some text E some text
@Leksat
Leksat / test.md
Last active January 31, 2019 12:56

asd \ asd`

asd `` asd

asd ` asd

@Leksat
Leksat / Composer JS libraries example.diff
Created April 26, 2017 08:03
In this example we add masonry, imagesloaded, and dropzone libraries to Composer.
diff --git a/.gitignore b/.gitignore
index fc00ed5..ac82bec 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,6 +5,7 @@ web/core
web/modules/contrib
web/themes/contrib
web/profiles/contrib
+web/libraries
@Leksat
Leksat / gist:815dcc153b4650b321ab
Created July 3, 2015 14:31
Drupal 8 custom entity type
Target: custom entity type, not config entity, nor content entity
# implementation 1:
- entity: EntityInterface
- storage: EntityStorageInterface
- query service:
- QueryFactoryInterface
- QueryInterface
- ConditionInterface
# implementation 2:
#!/usr/bin/php
<?php
$input = file_get_contents('php://stdin');
preg_match('|^To: (.*)|', $input, $matches);
$t = '/Users/alex/outgoing_mails/' . date('Y-m-d_H-i-s') . '---' . $matches[1] . '---' . uniqid() . '.eml';
file_put_contents($t, $input);
chmod($t, 0666);
@Leksat
Leksat / gist:4245cda7b3f6d1d4c2f8
Created June 7, 2014 09:02
drupal, union, count query, pagerdefault
solution: https://drupal.org/node/1145076#comment-7673535