Skip to content

Instantly share code, notes, and snippets.

View anildigital's full-sized avatar

Anil Wadghule anildigital

  • Pune, India
  • 23:42 (UTC +05:30)
View GitHub Profile

GENERAL TASK WORKFLOW

PHASE 1: TASK ANALYSIS (MANDATORY)

Step 1.1: Understand the Request

YOU MUST:

  1. Parse what exactly is being asked
  2. Identify if this is a feature (use feature.md) or fix (use fix.md)
  3. If neither, continue with this workflow
  4. Break down into specific, measurable subtasks

BUG FIX WORKFLOW

THIS IS A MANDATORY WORKFLOW - ALL STEPS MUST BE COMPLETED IN ORDER

PHASE 1: UNDERSTANDING THE BUG (MANDATORY)

Step 1.1: Initial Investigation

REQUIRED ACTIONS:

  • Get exact error message/behavior description
  • Identify affected module/function using grep/glob

FEATURE IMPLEMENTATION WORKFLOW

THIS IS A MANDATORY WORKFLOW - NO STEPS CAN BE SKIPPED

PHASE 1: RESEARCH & PLANNING (MANDATORY)

Step 1.1: Initial Research

YOU MUST USE ALL AVAILABLE RESOURCES:

  • Check existing usage rules via get_usage_rules MCP tool or CLAUDE.md links
  • Use package_docs_search for ALL potentially relevant packages
@devdumpling
devdumpling / backup_and_push.sh
Created August 25, 2024 18:06
Sync zed config
#!/bin/bash
# This is a simple script to copy non tmp files from zed config to a repo you can use for storing your config.
# This is slightly modified from what I actually use, which stores a number of other config files that I share across machines.
# rsync is used instead of cp for flexibility
ZED_SOURCE_DIR="/Users/USER/.config/zed"
ZED_DEST_DIR="/Users/USER/PATH_TO_SYNC_REPO/.config/zed"
# absolute path to repo storing your config
@PJUllrich
PJUllrich / big-o.md
Last active May 28, 2025 20:29
Big-O Time Complexities for Elixir Data Structures

Big-O Time Complexities for Elixir data structures

Map [1]

Operation Time Complexity
Access O(log n)
Search O(log n)
Insertion O(n) for <= 32 elements, O(log n) for > 32 elements [2]
Deletion O(n) for <= 32 elements, O(log n) for > 32 elements
@myobie
myobie / poller.ex
Last active April 8, 2021 11:42
GenServer for longpoll requests with backoff in case of errors
defmodule Example.Poller do
use GenServer
@backoff [
50,
100,
150,
250,
400,
650
(defface tree-sitter-hl-face:warning
'((default :inherit font-lock-warning-face))
"Face for parser errors"
:group 'tree-sitter-hl-faces)
(defun hook/tree-sitter-common ()
(unless font-lock-defaults
(setq font-lock-defaults '(nil)))
(setq tree-sitter-hl-use-font-lock-keywords nil)
(tree-sitter-mode +1)
# This is the proper BEAM test for https://github.com/uber/denial-by-dns. The Erlang test in that repo is sequential
# (https://github.com/uber/denial-by-dns/blob/b809cc561a691d9d6201d06d38d06c33c9c9f9ec/erlang-httpc/main.erl)
# which is not consistent with the test description (https://github.com/uber/denial-by-dns/tree/b809cc561a691d9d6201d06d38d06c33c9c9f9ec#how-it-works)
# and also differs from e.g. go test in the same repo which issues requests concurrently.
#
# Consequently, the conclusion in that repo as well as the original article (https://eng.uber.com/denial-by-dns/) is incorrect.
# A properly written Erlang test would pass, as demonstrated by this Elixir script.
#
# This code performs a slightly refined and a correct version of that tests in Elixir:
#
@henrik
henrik / each_in_thread_pool.rb
Last active February 2, 2021 16:55
Run a block on a list of things in a limited number of concurrent threads. Mostly for the fun of it – there are more featureful libs like https://github.com/grosser/parallel.
# Lets you call a block for each item in a list, just like `each`.
# But instead of running serially, it runs in a limited number of parallel threads.
# This is useful when you don't just want one thread per item, e.g. to avoid rate limiting or network saturation.
class EachInThreadPool
def self.call(inputs, pool_size:, &block)
queue = Queue.new
inputs.each { queue << _1 }
pool_size.times.map {
@apboobalan
apboobalan / elixir_typespec.md
Created September 4, 2020 09:21
Gist about typespecs in Elixir
  • To define type spec for a functions @spec function_name(arg_1_type, arg_2_type) :: return_type
  • To define new type@type new_type_name :: existing_type
  • To document type place @typedoc """ description """ above type definition.
  • We can create product types such as lists, tuples and maps using their own syntax with members being the types.
  • Eg. Product types
@type statuses :: [atom]

@type number_with_remark :: {number, String.t}