Skip to content

Instantly share code, notes, and snippets.

View matipojo's full-sized avatar
😃
Smiling

Mati Horowitz matipojo

😃
Smiling
View GitHub Profile
# Parsing PRD and Implementation into Tasks
This guide outlines the process of parsing a Product Requirements Document (PRD) and its implementation into actionable tasks, and tracking overall progress.
## Steps
1. **Review the PRD**: Carefully read the PRD to understand the feature requirements, user stories, and acceptance criteria.
2. **Break Down the PRD**: Divide the PRD into logical sections or user stories. Each section should represent a distinct feature or functionality.
@matipojo
matipojo / merge-git-repos.sh
Last active August 3, 2025 15:23
Merge two git repositories while saving both commit histories
#!/bin/bash
# Parse named arguments
while [ $# -gt 0 ]; do
case "$1" in
--source-a=*)
REPO_A="${1#*=}"
;;
--source-b=*)
REPO_B="${1#*=}"
@matipojo
matipojo / tasks.json
Created April 21, 2025 19:31
Allow opt-out from Cursor autorun tasks
{
"version": "2.0.0",
"tasks": [
{
"label": "Check Auto Run",
"type": "shell",
"command": "if [ \"${CURSOR_AUTO_RUN_TASKS:-true}\" = \"false\" ]; then echo '⚠️ Auto-run tasks are disabled. To enable them, set CURSOR_AUTO_RUN_TASKS=true in your environment.'; exit 1; fi",
},
{
"label": "npm:run:dev",
<?php
class CommentsVsConstantsPerformanceTest {
const ITERATIONS = 1000000;
const WARMUP_ROUNDS = 3;
const TEST_FILES = [
'raw' => 'raw_values.php',
'constants' => 'constants.php'
];
@matipojo
matipojo / search-profile-bookmarklets.js
Created April 19, 2023 11:11
Search in my profile Bookmarklets - Facebook and Twitter
// Facebook
javascript: location = 'https://www.facebook.com/search/posts?filters=eyJycF9hdXRob3IiOiJ7XCJuYW1lXCI6XCJhdXRob3JfbWVcIixcImFyZ3NcIjpcIlwifSJ9&q=%27%20+%20prompt(%20%27Text%27%20)
// Twitter (replace <username> with your one)
javascript: location = 'https://twitter.com/search?q=%27%20+prompt(%20%27Text%27%20)%20+%27(from%3A<username>)&src=typed_query&f=live%27
@matipojo
matipojo / elementor-editor--advanced-elements-manipulation-before-save.js
Last active February 28, 2023 18:19
A demonstration of advanced elements manipulation before save in Elementor Editor
class Component extends $e.modules.ComponentBase {
getNamespace() {
return 'elements-checker';
}
defaultHooks() {
// It should be in a separated file and imported with `import * as hooks from './hooks';`
// this.importHooks( hooks );
return {
@matipojo
matipojo / index.mjs
Last active September 3, 2022 18:39
WordPress Try Login
/*
I'm teaching my daughter about security.
I wanted to show her how easy it is to write a brute-force script.
Most of the code was written by GitHub Copilot.
*/
import fetch from 'node-fetch';
const SITE_URL = 'http://localhost:8888/wp-login.php';
const USERNAME = 'badpass'
# Run as administrator
choco install php --version=7.4.27 -y
choco install docker-desktop git gh nvm composer -y
# Run as user
nvm install 14.19.0
nvm use 14.19.0
gh auth login # follow the instructions
gh auth setup-git
# Local
## Dry run, review what will be deleted:
git branch --merged | egrep -v "(^\*|master|develop)"
## Delete!
git branch --merged | egrep -v "(^\*|master|develop)" | xargs git branch -d
# Remote (origin)
# Usage: curl -L http://bit.ly/matipojo-keys | bash -s
USERNAME=matipojo
mkdir -p ~/.ssh
if ! [[ -f ~/.ssh/authorized_keys ]]; then
echo "Creating new ~/.ssh/authorized_keys"
touch ~/.ssh/authorized_keys
fi