Skip to content

Instantly share code, notes, and snippets.

View scturtle's full-sized avatar
🐢

scturtle

🐢
View GitHub Profile
import os
import torch
import torch.distributed as dist
import lovely_tensors as lt; lt.monkey_patch()
def split_tensor(data: torch.Tensor, dim: int) -> torch.Tensor:
rank = dist.get_rank()
world_size = dist.get_world_size()
@rougier
rougier / nano.el
Created February 4, 2025 18:48
NANO Emacs (minimal version: 256 lines)
;; nano-emacs.el --- NANO Emacs (minimal version) -*- lexical-binding: t -*-
;; Copyright (c) 2025 Nicolas P. Rougier
;; Released under the GNU General Public License 3.0
;; Author: Nicolas P. Rougier <[email protected]>
;; URL: https://github.com/rougier/nano-emacs
;; This is NANO Emacs in 256 lines, without any dependency
;; Usage (command line): emacs -Q -l nano.el -[light|dark]
@amno1
amno1 / buffer-faces.el
Last active July 18, 2025 08:58
Show All Faces Being Used in a Buffer
;;; buffer-faces.el --- show all faces being used in a buffer -*- lexical-binding: t -*-
;; Copyright (C) 2011 Jonathan Rockway
;; Author: Jonathan Rockway <[email protected]>
;; Keywords:
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or