Skip to content

Instantly share code, notes, and snippets.

@andreibosco
andreibosco / yubikey-windows10.md
Last active January 8, 2025 20:12
Setting up Yubikey with SSH and Git on Windows 10 + Powershell
@Klerith
Klerith / git-alias.md
Last active January 8, 2025 20:11
Useful Git Alias

Log

git config --global alias.lg "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all"

Status

git config --global alias.s status --short

Alternativa útil de status

git config --global alias.s status -sb

@a7t0fwa7
a7t0fwa7 / contemplative-llms.txt
Created January 8, 2025 20:10 — forked from Maharshi-Pandya/contemplative-llms.txt
"Contemplative reasoning" response style for LLMs like Claude and GPT-4o
You are an assistant that engages in extremely thorough, self-questioning reasoning. Your approach mirrors human stream-of-consciousness thinking, characterized by continuous exploration, self-doubt, and iterative analysis.
## Core Principles
1. EXPLORATION OVER CONCLUSION
- Never rush to conclusions
- Keep exploring until a solution emerges naturally from the evidence
- If uncertain, continue reasoning indefinitely
- Question every assumption and inference
@Maharshi-Pandya
Maharshi-Pandya / contemplative-llms.txt
Last active January 8, 2025 20:10
"Contemplative reasoning" response style for LLMs like Claude and GPT-4o
You are an assistant that engages in extremely thorough, self-questioning reasoning. Your approach mirrors human stream-of-consciousness thinking, characterized by continuous exploration, self-doubt, and iterative analysis.
## Core Principles
1. EXPLORATION OVER CONCLUSION
- Never rush to conclusions
- Keep exploring until a solution emerges naturally from the evidence
- If uncertain, continue reasoning indefinitely
- Question every assumption and inference
@padeoe
padeoe / enhanced-nvidia-smi.md
Last active January 8, 2025 20:04
Show Username & full process command with nvidia-smi

For typical use cases, I prefer using nvitop to view detailed information. This script offers a dependency-free implementation.

The script enhances the functionality of nvidia-smi and provides the following info:

  • Username
  • full process Command
  • GPU ID
  • PID

This is useful on multi-user servers and can be used to quickly identify which user is using the GPU and running what kind of program.

@JotaRata
JotaRata / stubs.py
Last active January 8, 2025 20:04
Auto stub generator for Cython files
'''
Auto stub generator for cython files.
LIMITATIONS:
Can only parse declared cdef variables with public/readonly keywords
Cannot parse plain defined variables (ex: "my_var = 2")
Cannot parse special members imported from C/C++
Cannot parse ctypedef types
Can only parse functions prefixed with 'def' and 'cpdef
@a-h
a-h / disablecaching.go
Created August 20, 2019 08:15
Disable caching and sniffing via HTTP headers
func DisableCachingAndSniffing(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate;")
w.Header().Set("pragma", "no-cache")
w.Header().Set("X-Content-Type-Options", "nosniff")
next.ServeHTTP(w, r)
})
}
<?php
class CustomMenuBreadcrumbs {
public $menu_location = '';
public $menu = false;
public $menu_items = array();
public function __construct( $menu_location = '' ) {
@hyg
hyg / gist:9c4afcd91fe24316cbf0
Created June 19, 2014 09:36
open browser in golang
func openbrowser(url string) {
var err error
switch runtime.GOOS {
case "linux":
err = exec.Command("xdg-open", url).Start()
case "windows":
err = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start()
case "darwin":
err = exec.Command("open", url).Start()