Skip to content

Instantly share code, notes, and snippets.

@feveromo
feveromo / Claude MCP Windows.md
Last active January 16, 2025 17:35
MCP-Windows

Setting Up MCP Servers on Windows

A step-by-step guide to setting up Model Context Protocol (MCP) servers for Claude Desktop on Windows.

Prerequisites

  1. Install Node.js (v18.x or later)
    • Download from: https://nodejs.org/
    • Verify installation by opening Command Prompt (CMD) and running:
      node --version
      npm --version
@KonnorRogers
KonnorRogers / capybara_read_spec.rb
Created April 22, 2021 21:26
Clipboard reading in Capybara
it "should read clipboard text" do
page.driver.browser.execute_cdp(
"Browser.setPermission",
{
origin: page.server_url,
permission: { name: "clipboard-read" },
setting: "granted",
})
clip_text = page.evaluate_async_script("navigator.clipboard.readText().then(arguments[0])")
expect(clip_text).to eq("copied text")
@DabbyNdubisi
DabbyNdubisi / NavigationAllowedDismissalGesturesModifier.swift
Last active January 16, 2025 17:34
Control Interactive Dismissal of Navigation Zoom Transition SwiftUI
import SwiftUI
import UIKit
import Foundation
// MARK: - AllowedNavigationDismissalGestures
public struct AllowedNavigationDismissalGestures: OptionSet, Sendable {
public let rawValue: Int
public init(rawValue: Int) {
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active January 16, 2025 17:34
Conventional Commits Cheatsheet

Conventional Commit Messages starline

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions, determine version and generate changelogs

Commit Message Formats

Default

User authentication system

Your task is now to create a user authentication system.

This document will guide you through all the features and implication of such system, so that you don't have to search them yourself.

We will focus on web/browser-technologies, however similar concept can be widely applied. This guide, is a work in progress, feel free to comment and provide feedbacks.

Expected Workflows

@philschmid
philschmid / get_memory_size.py
Created January 16, 2025 13:53
Get needed GPU per precision for a Hugging Face Model Id
from typing import Dict, Union
from huggingface_hub import get_safetensors_metadata
import argparse
import sys
# Example:
# python get_gpu_memory.py Qwen/Qwen2.5-7B-Instruct
# Dictionary mapping dtype strings to their byte sizes
bytes_per_dtype: Dict[str, float] = {
@bozdag
bozdag / taking screenshot in linux with C
Last active January 16, 2025 17:30
This C program takes the whole screenshot of the root window for a given display and saves it in PNG file format.
/*
Grabs a screenshot of the root window.
Usage : ./scr_tool <display> <output file>
Example : ./scr_tool :0 /path/to/output.png
Author: S Bozdag <[email protected]>
*/
@elowy01
elowy01 / BCFtools cheat sheet
Last active January 16, 2025 17:29
BCFtools cheat sheet
*bcftools filter
*Filter variants per region (in this example, print out only variants mapped to chr1 and chr2)
qbcftools filter -r1,2 ALL.chip.omni_broad_sanger_combined.20140818.snps.genotypes.hg38.vcf.gz
*printing out info for only 2 samples:
bcftools view -s NA20818,NA20819 filename.vcf.gz
*printing stats only for variants passing the filter:
bcftools view -f PASS filename.vcf.gz
@bigbosst
bigbosst / BackupRotated
Created August 6, 2019 14:09
A simple rotational backup script that will rotate daily, weekly, monthly, and yearly backups.
#!/bin/bash
SRC_DIR="/var/www/html"
BACKUP_DIR="/mnt/backups"
PROJECT_NAME="project"
BACKUP_RETENTION_DAILY=6
BACKUP_RETENTION_WEEKLY=3
BACKUP_RETENTION_MONTHLY=3
BACKUP_RETENTION_YEARLY=0