Skip to content

Instantly share code, notes, and snippets.

@jdeathe
jdeathe / make-local-cert.sh
Last active April 8, 2025 02:36
Generate a Root CA + Intermediate CA for local (internal) use on Mac OSX using cfssl and add the intermediate certificate to your keychain so it can be trusted by your local browser.
#!/usr/bin/env bash
# REF: https://github.com/cloudflare/cfssl
# Change working directory
cd -- "$(
dirname "${0}"
)" || exit 1
readonly CA_ROOT_CERT_KEY="ca-root"
@Krumelur
Krumelur / Awaitable.cs
Created December 4, 2015 07:36
Shows how to make any class "awaitable".
using System;
using System.Threading.Tasks;
using System.Runtime.CompilerServices;
namespace AwaitTest
{
class MainClass
{
public static void Main (string[] args)
{
@sshh12
sshh12 / cursor-agent-system-prompt.txt
Last active April 8, 2025 02:31
Cursor Agent System Prompt (March 2025)
You are a powerful agentic AI coding assistant, powered by Claude 3.5 Sonnet. You operate exclusively in Cursor, the world's best IDE.
You are pair programming with a USER to solve their coding task.
The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question.
Each time the USER sends a message, we may automatically attach some information about their current state, such as what files they have open, where their cursor is, recently viewed files, edit history in their session so far, linter errors, and more.
This information may or may not be relevant to the coding task, it is up for you to decide.
Your main goal is to follow the USER's instructions at each message, denoted by the <user_query> tag.
<communication>
1. Be conversational but professional.
// ==UserScript==
// @name Civitai Ad Div Remover
// @namespace https://civitai.com/user/superskirv
// @version 0.3
// @description Removes add cell from the front page, and possibly others.
// @author Super.Skirv and Qwen2.5-QwQ
// @match https://civitai.com/*
// @icon https://civitai.com/images/android-chrome-192x192.png
// @grant none
// ==/UserScript==
@ysegorov
ysegorov / 00-voidlinux-fde-detached-header-remote-unlock.md
Last active April 8, 2025 02:28
Void Linux Full Disk Encryption with detached header, remote unlock and /boot on USB stick

Void Linux Full Disk Encryption with detached header, remote unlock and /boot on USB stick

This is a short description of steps to have new secure Void Linux installation with following features:

  • /boot partition on USB stick (not encrypted)
  • full disk encryption with detached LUKS header on USB stick
  • LVM on top of the encrypted partition
  • remote unlocking of the encrypted partition
  • mkinitcpio to generate initramfs
@chadaustin
chadaustin / colortest.rs
Created January 2, 2024 04:52
Detect Terminal Color and Character Attribute Support
#!/usr/bin/env -S rust-script -t nightly
#![feature(unix_sigpipe)]
use std::cmp::max;
const BASIC_COLORS: &[&str] = &[
"black", "red", "green", "yellow", "blue", "magenta", "cyan", "white",
];
fn title(t: &str) {
@lzwcom
lzwcom / excel_dispatch_client.cpp
Created April 5, 2025 10:19 — forked from derrickturk/excel_dispatch_client.cpp
An IDispatch client that launches Excel for 25 seconds.
// build with g++ -std=c++14 -O2 -Wall -Wextra -pedantic -static -o excel_dispatch_client excel_dispatch_client.cpp -lole32 -luuid
#include <cstdlib>
#include <iostream>
#include <exception>
#include <memory>
#include <string>
#include <sstream>
#include <vector>
#include <unordered_map>
import torch
import torch.nn as nn
import torch.nn.functional as F
from dataclasses import dataclass
import transformers.modeling_bert as modeling_bert
import nlpr.shared.torch_utils as torch_utils
import nlpr.shared.model_resolution as model_resolution
@Daysaants
Daysaants / Cursos
Created April 8, 2025 02:05
Cursos
SELECT
s.name AS escola,
st.enrolled_at::date AS data_matricula,
COUNT(*) AS qtd_alunos,
SUM(c.price) AS total_matriculas
FROM
students st
JOIN
courses c ON st.course_id = c.id
JOIN
@sundowndev
sundowndev / GoogleDorking.md
Last active April 8, 2025 02:20
Google dork cheatsheet

Google dork cheatsheet

Search filters

Filter Description Example
allintext Searches for occurrences of all the keywords given. allintext:"keyword"
intext Searches for the occurrences of keywords all at once or one at a time. intext:"keyword"
inurl Searches for a URL matching one of the keywords. inurl:"keyword"
allinurl Searches for a URL matching all the keywords in the query. allinurl:"keyword"
intitle Searches for occurrences of keywords in title all or one. intitle:"keyword"