Skip to content

Instantly share code, notes, and snippets.

@emiloberg
emiloberg / promise.ts
Last active March 21, 2025 18:20
Type-safe promise.allSettled where a promise may or may not be required
type PromiseObject<T> = {
promise: Promise<T>;
required: boolean;
};
type PromiseResult<T> = T extends Promise<infer U> ? U : never;
type PromiseResults<T extends readonly PromiseObject<unknown>[]> = {
[K in keyof T]: T[K]['required'] extends true
? PromiseResult<T[K]['promise']>
@sh1n0b1
sh1n0b1 / linuxprivchecker.py
Created July 13, 2015 23:36
linuxprivchecker.py -- a Linux Privilege Escalation Check Script
#!/usr/env python
###############################################################################################################
## [Title]: linuxprivchecker.py -- a Linux Privilege Escalation Check Script
## [Author]: Mike Czumak (T_v3rn1x) -- @SecuritySift
##-------------------------------------------------------------------------------------------------------------
## [Details]:
## This script is intended to be executed locally on a Linux box to enumerate basic system info and
## search for common privilege escalation vectors such as world writable files, misconfigurations, clear-text
## passwords and applicable exploits.
@Madhav-MKNC
Madhav-MKNC / coding-agent.py
Last active March 21, 2025 18:19
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."""
@PrinceSinghhub
PrinceSinghhub / 📅 DSA Calendar 2025.md
Last active March 21, 2025 18:18
This roadmap is designed to cover all fundamental and advanced DSA topics systematically, allowing you to master patterns and algorithms before diving into hardcore problem-solving.

📅 DSA Calendar 2025


📌 DSA Plan (Day-Wise Breakdown)

Topic Days Importance Status
Arrays 10 ⭐⭐⭐⭐ Not Started
Two Pointer & Sliding Window 5 ⭐⭐⭐ Not Started
@Chuvisco88
Chuvisco88 / redeem.js
Last active March 21, 2025 18:17
A small script for getting free stuff from the unity asset store
/*
HOW TO USE
##########
- Go to the unity asset store (https://assetstore.unity.com/)
- Select any category and adapt filters to what you want to get
It is recommended to set the "Hide Purchased Assets" and "Free Assets" to reduce working load.
You might also set other filters like for example only 3D Characters or 4+ star ratings only
- Open up the developer console (normally F12)
- Copy this script to the Console (you might change the consts at the beginning, numbers are in milliseconds)
- Write "redeemAll();" (without the quotes) in the console and hit enter
@t3dotgg
t3dotgg / try-catch.ts
Last active March 21, 2025 18:15
Theo's preferred way of handling try/catch in TypeScript
// Types for the result object with discriminated union
type Success<T> = {
data: T;
error: null;
};
type Failure<E> = {
data: null;
error: E;
};
Windows 7 Ultimate Retail Offline Activation Key
BR6G7-729GM-DQDQW-F9M4P-MM2JX
J6XG4-8JFTF-43CHH-8Q2VW-KHQH6
YQMCM-3W6TK-YXP66-GKCJV-PX7PH
[Tested working on 18 June 2013]
=================================================================================
Windows 7 Pro / Enterprise Online Activation MAK Key
@Kinyugo
Kinyugo / install_cursor.sh
Last active March 21, 2025 18:10
Cursor AI IDE Installer and Updater Script
#!/bin/bash
installCursor() {
local CURSOR_URL="https://downloader.cursor.sh/linux/appImage/x64"
local ICON_URL="https://miro.medium.com/v2/resize:fit:700/1*YLg8VpqXaTyRHJoStnMuog.png"
local APPIMAGE_PATH="/opt/cursor.appimage"
local ICON_PATH="/opt/cursor.png"
local DESKTOP_ENTRY_PATH="/usr/share/applications/cursor.desktop"
echo "Checking for existing Cursor installation..."
@joeblackwaslike
joeblackwaslike / How-to-Python-in-Cursor.md
Last active March 21, 2025 18:10
How to use python with the Cursor IDE

How to use python with the Cursor AI IDE

We are going to edit cursors settings to point to the microsoft extensions marketplace.

  1. Remove all extensions and exit Cursor.
  2. Locate your Cursor project.json file depending on your platform and open it.
    • On MacOS: /Applications/Cursor.app/Contents/Resources/app/product.json
    • On Windows: C:\Users\<user_name>\AppData\Local\Programs\cursor\resources\app\product.json
    • On Linux: /usr/lib/code/product.json
  3. Locate the object value for key extensionsGallery in the json document.