Skip to content

Instantly share code, notes, and snippets.

@jsuryahyd
jsuryahyd / commands.sh
Created September 28, 2023 10:41
disable zscaler on mac
# https://www.atpeaz.com/disable-zscaler-temporarily-on-your-mac/
# disable
sudo launchctl unload /Library/LaunchDaemons/com.zscaler.service.plist && sudo launchctl unload /Library/LaunchDaemons/com.zscaler.tunnel.plist
# Reenable
sudo launchctl load /Library/LaunchDaemons/com.zscaler.service.plist && sudo launchctl load /Library/LaunchDaemons/com.zscaler.tunnel.plist
@c4mx
c4mx / wpa2_psk_auth.py
Last active March 6, 2025 21:15
Calculate PMK, PTK, MIC and MIC verification in WPA2-PSK authentication
#!/usr/bin/env python
# __author__ = 'c4mx'
from pbkdf2 import PBKDF2
from binascii import a2b_hex
import hmac, hashlib, binascii
# passphrase: WPA wifi password
def calc_pmk(passphrase, ssid):
return PBKDF2(passphrase, ssid, 4096).read(32)
@dminkovski
dminkovski / copilot-instructions.txt
Created February 12, 2025 22:57
copilot-instructions.txt
# GitHub Copilot Instructions for REST API Development
## General Guidelines:
- Follow modern **TypeScript** best practices.
- Prioritize **modular and reusable code** for maintainability.
- Always use **ESLint** and **Prettier** for code formatting and linting.
- Ensure compatibility with **Node.js LTS versions**.
## API Development:
- Adhere to **RESTful API principles**.
@danhollick
danhollick / tailwind-css-v4.mdc
Last active March 6, 2025 21:12
Cursor rules file for Tailwind CSS v4.0
# Tailwind CSS v4.0
## Core Changes
- **CSS-first configuration**: Configuration is now done in CSS instead of JavaScript
- Use `@theme` directive in CSS instead of `tailwind.config.js`
- Example:
```css
@import "tailwindcss";
@m5lil
m5lil / reset.sh
Last active March 6, 2025 21:11
[reset jetbrains application trial] reset jetbrains ide evals v1.0.4 #others
#!/bin/bash
# reset jetbrains ide evals v1.0.4
OS_NAME=$(uname -s)
JB_PRODUCTS="IntelliJIdea CLion PhpStorm GoLand PyCharm WebStorm Rider DataGrip RubyMine AppCode"
if [ "$OS_NAME" == "Darwin" ]; then
echo 'macOS:'
for PRD in $JB_PRODUCTS; do
@mihow
mihow / load_dotenv.sh
Last active March 6, 2025 21:11
Load environment variables from dotenv / .env file in Bash
# The initial version
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
# My favorite from the comments. Thanks @richarddewit & others!
set -a && source .env && set +a
@MercyShark
MercyShark / partition.md
Last active March 6, 2025 21:11
My test gist

Database partition

@zchee
zchee / actionlist.vim
Last active March 6, 2025 21:09
IdeaVim actionlist
--- Actions ---
$Copy <M-C>
$Cut <M-X> <S-Del>
$Delete <Del> <BS> <M-BS>
$LRU
$Paste <M-V>
$Redo <M-S-Z> <A-S-BS>
$SearchWeb <A-S-G>
$SelectAll <M-A>
$Undo <M-Z>
@letelete
letelete / use-schedule.ts
Last active March 6, 2025 21:02
A hook for scheduling function executions with deduplication and priority management. Requires: https://usehooks-ts.com/react-hook/use-unmount.
import { useCallback, useMemo, useRef } from 'react';
import { useUnmount } from '~lib/hooks/use-unmount';
import type { VoidFn } from '~lib/utils/types';
interface ScheduleOptions {
tag?: string;
}
interface ScheduleOnceOptions {