Skip to content

Instantly share code, notes, and snippets.

View ColtHands's full-sized avatar
🐢

Aleksei Karpenko ColtHands

🐢
View GitHub Profile
@ColtHands
ColtHands / doc-cuauthoring.skill.md
Last active December 29, 2025 10:29
Prompts, Agents, Skills
name description
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks.

Doc Co-Authoring Workflow

This skill provides a structured workflow for guiding users through collaborative document creation. Act as an active guide, walking users through three stages: Context Gathering, Refinement & Structure, and Reader Testing.

When to Offer This Workflow

@ColtHands
ColtHands / .zshrc
Last active May 29, 2025 06:01
My zshell config
get_git_branch() {
git rev-parse --abbrev-ref HEAD 2>/dev/null
}
get_git_repo() {
basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null
}
has_unstaged_changes() {
if [[ -n $(git status --porcelain 2>/dev/null) ]]; then
@ColtHands
ColtHands / Readme.md
Last active December 24, 2024 17:01
Rust macros

List of useful macros

log!

This macro just logs values (think console.log in js).

Example usage: log!(1,2,3,"hello world", [1,2,3])

min!

@ColtHands
ColtHands / reactive.js
Created September 11, 2023 11:07 — forked from 1Marc/reactive.js
Vanilla Reactive System
// Credit Ryan Carniato https://frontendmasters.com/courses/reactivity-solidjs/
let context = [];
export function untrack(fn) {
const prevContext = context;
context = [];
const res = fn();
context = prevContext;
return res;
@ColtHands
ColtHands / JS RegExp Snippets.md
Last active September 9, 2022 13:26
JS RegExp Snippets

JS RegExp Snippets

Match a string between two characters

(?<=\+)(.*)(?=\@) will match world in hello+world@mail.com

  1. start at + with (?<=\+)
  2. select all characters with (.*)
  3. end at @ with (?-\@)

Match the string exactly

@ColtHands
ColtHands / GitSnippets.md
Last active December 11, 2024 10:28
Git Snippets

Git Snippets

How to remove file that was added to .gitignore after it was commited.

git rm {file_name} --cached

How to add changes to previous not pushed commit.

git commit --amend --no-edit

@ColtHands
ColtHands / README.md
Last active September 16, 2020 22:15
jQuery to Vanilla.js

jQuery to Vanilla.js

Selecting elements

$("selector")

  • document.querySelector('#id')
  • document.querySelectorAll('.class > ul li')
  • document.getElementById('id')
  • document.getElementsByClassName('class')
@ColtHands
ColtHands / ogrn-array.json
Last active November 3, 2021 16:14
Ogrn array
[
526017964561,
525608647855,
526013197030,
526017918501,
526013196478,
526200201544,
526200024126,
526014627350,
526006502928,
@ColtHands
ColtHands / react-click-outside-component.jsx
Created August 16, 2020 18:55
React click outside of component
componentDidMount() {
document.addEventListener('click', this.clickOutside.bind(this), true);
}
componentWillUnmount() {
document.removeEventListener('click', this.clickOutside.bind(this), true);
}
clickOutside(event) {
const domNode = ReactDOM.findDOMNode(this);
@ColtHands
ColtHands / vue-click-outside-element.js
Created August 16, 2020 18:25
Vue click outside element directive
Vue.directive('click-outside-element', {
bind(el, bind, vn) {
el.cO = event => {
if (!(el == event.target || el.contains(event.target))) {
if(vn.context[bind.expression]) {
vn.context[bind.expression](event)
}
}
}
document.body.addEventListener('click', el.cO)