Skip to content

Instantly share code, notes, and snippets.

Manage Multiple Claude Code Accounts

Run two Claude Code accounts simultaneously on macOS without re-authenticating by using separate configuration directories.

Steps

  1. Create Separate Config Directories
    mkdir ~/.claude-account1
    mkdir ~/.claude-account2
@nhatnx
nhatnx / claude_quick.sh
Last active September 20, 2026 15:45 — forked from stracker-phil/claude_quick.sh
Cleaned up, verified and translated version of weidwonder/claude-desktop-multi-instance
#!/bin/bash
# Claude Desktop Multi-Instance Launcher
#
# Uses Electron's --user-data-dir flag to run fully isolated instances.
# Each instance gets its own data directory (config, VM bundles, SDK, sessions).
#
# Need to make the helper executable
# chmod +x ./claude_quick.sh
#
@nhatnx
nhatnx / 20+ Powerful Agentic-Skills for Claude, ChatGPT & Gemini.md
Last active April 15, 2026 04:04
20+ Powerful Agentic-Skills for Claude, ChatGPT & Gemini...

Here are 20+ powerful agentic skills you can add to any AI model to boost your productivity.

Each skill is written in .md format, which is the standard for Claude. You can still copy the documents and paste them into ChatGPT or Gemini whenever you need to use the skill.

The skills are grouped into 5 categories:

Writing & Content Skills

- SCQA Writing Framework:

@nhatnx
nhatnx / import_large_dump_file.md
Created January 8, 2025 07:51
[MySQL] Import a large (14 GB) MySQL dump file into a new MySQL database
mysql --u root --p

SET global
net_buffer_length=1000000; --Set network buffer length to a large byte number

SET global
max_allowed_packet=1000000000; --Set maximum allowed packet size to a large byte number

SET foreign_key_checks=0; --Disable foreign key checking to avoid delays, errors and unwanted behaviour
@nhatnx
nhatnx / git_prevent_auto_crlf.md
Created June 13, 2024 07:52
[Git] Prevent git from converting CRLF automatically in Windows and Unix
  • Open .git/config file.
  • Add autocrlf = false and safecrlf = true to [core] section.
  • Save the file.
@nhatnx
nhatnx / input_datetime_format.css
Created June 22, 2022 09:34
Change HTML default input datetime format
input.datetime {
position: relative;
width: 158px;
height: 38px;
color: white;
}
input.datetime:before {
position: absolute;
top: 8px;
import * as React from "react";
import { useMousePosition } from "~/hooks/useMousePosition";
/** Component to cover the area between the mouse cursor and the sub-menu, to allow moving cursor to lower parts of sub-menu without the sub-menu disappearing. */
export function MouseSafeArea(props: { parentRef: React.RefObject<HTMLDivElement> }) {
const { x = 0, y = 0, height: h = 0, width: w = 0 } = props.parentRef.current?.getBoundingClientRect() || {};
const [mouseX, mouseY] = useMousePosition();
const positions = { x, y, h, w, mouseX, mouseY };
return (
<div
@nhatnx
nhatnx / alter_tables_charset.sql
Last active August 12, 2021 04:05
[MySQL] Alter charset of all tables and their columns
-- Query to convert table and all its column type to utf8
ALTER TABLE <Table_Name> CONVERT TO CHARACTER SET utf8;
-- Query to generate Alter Table for all tables
SELECT CONCAT("ALTER TABLE ", TABLE_SCHEMA, '.', TABLE_NAME," CONVERT TO CHARACTER SET utf8;") AS ExecuteTheString
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA="<Database_Name>"
AND TABLE_TYPE="BASE TABLE";
//// ES 5
function onlyUnique(value, index, self) {
return self.indexOf(value) === index;
}
// usage example:
var a = ['a', 1, 'a', 2, '1'];
var unique = a.filter(onlyUnique);
console.log(unique); // ['a', 1, 2, '1']
@nhatnx
nhatnx / prevent_copy.js
Created October 1, 2020 05:13
Prevents user from copying the text from form fields, either by copy/cut or dragging and dropping text
/* preventCopy()
* Prevents user from copying the text from form fields, either by copy/cut or dragging and dropping text.
* Binds preventDefault() to oncopy and oncut events.
* Binds event that makes all fields in selector readonly for onmousedown event. (Doesn't make target field readonly.)
* Binds event that removes readonly for onmouseup event.
* MSIE bug requires a user to click twice after readonly has been removed. Focus() doesn't work, use select().
* I specifically allowed pasting because the issue is really the copying.
* @param selector string required - jQuery selector for form field(s). As allowed by jQuery, this is typically a list of selectors in one string.
* @return void
*/