Skip to content

Instantly share code, notes, and snippets.

View Vikaskumargd's full-sized avatar
🎯
Focusing

Vikas Kumar Vikaskumargd

🎯
Focusing
View GitHub Profile

Writing Style Prompt

  • Focus on clarity: Make your message really easy to understand.
    • Example: "Please send the file by Monday."
  • Be direct and concise: Get to the point; remove unnecessary words.
    • Example: "We should meet tomorrow."
  • Use simple language: Write plainly with short sentences.
    • Example: "I need help with this issue."
  • Stay away from fluff: Avoid unnecessary adjectives and adverbs.
  • Example: "We finished the task."
@Vikaskumargd
Vikaskumargd / .py
Created March 16, 2025 21:33 — forked from Madhav-MKNC/coding-agent.py
All the code you need to create a powerful agent that can create and edit any file on your computer using the new text_editor tool in the Anthropic API.
import anthropic
import os
import sys
from termcolor import colored
from dotenv import load_dotenv
class ClaudeAgent:
def __init__(self, api_key=None, model="claude-3-7-sonnet-20250219", max_tokens=4000):
"""Initialize the Claude agent with API key and model."""
@Madhav-MKNC
Madhav-MKNC / coding-agent.py
Last active May 15, 2025 22:43
All the code you need to create a powerful agent that can create and edit any file on your computer using the new text_editor tool in the Anthropic API.
import anthropic
import os
import sys
from termcolor import colored
from dotenv import load_dotenv
class ClaudeAgent:
def __init__(self, api_key=None, model="claude-3-7-sonnet-20250219", max_tokens=4000):
"""Initialize the Claude agent with API key and model."""
@Vikaskumargd
Vikaskumargd / useFetch.js
Created April 9, 2020 21:53 — forked from Dromediansk/useFetch.js
fetching data custom hook final version
import { useState, useEffect } from "react";
export const useFetch = (url, ref, initialValue) => {
const [data, setData] = useState(initialValue);
const [error, setError] = useState(null);
const [loading, setLoading] = useState(true);
useEffect(() => {
if (ref.current) {
(async () => {
@Dromediansk
Dromediansk / useFetch.js
Created April 8, 2020 02:59
fetching data custom hook final version
import { useState, useEffect } from "react";
export const useFetch = (url, ref, initialValue) => {
const [data, setData] = useState(initialValue);
const [error, setError] = useState(null);
const [loading, setLoading] = useState(true);
useEffect(() => {
if (ref.current) {
(async () => {
@johanquiroga
johanquiroga / useUndoReducer.js
Last active April 14, 2025 15:00
Undo/Redo capability for any reducer using react hook `useReducer`
import { useReducer } from 'react';
const useUndoReducer = (reducer, initialState) => {
const undoState = {
past: [],
present: initialState,
future: []
};
const undoReducer = (state, action) => {
@macbookandrew
macbookandrew / findStyles.js
Last active February 16, 2025 03:00
List unique CSS properties for all DOM elements
/**
* List unique CSS properties for all DOM elements
* Initially created to list unique font stacks on a page
* @see {@link http://stackoverflow.com/a/35022690/ Inspired by this StackOverflow answer}
*
* @see {@link https://gist.github.com/macbookandrew/f33dbbc0aa582d0515919dc5fb95c00a/ URL for this file}
*
* @author AndrewRMinion Design (https://andrewrminion.com)
* @version 1.1
*