emacs/templates

43 lines
1.2 KiB
Plaintext

nix-mode
(fhsenv "let" n
> "pkgs = import " (p "<nixpkgs>") " { };" n
> "fhs = pkgs.buildFHSUserEnv {" n
> "name = \"" (p "env") "\";" n
> "targetPkgs = _: [ " q " ];" n
> "profile = \"\";" n
> "};" n
"in" n
> "fhs.env")
(pyshell "import /etc/nixos/system/home/programming/pyshell.nix rec {" n
> "pkgs = import " (p "<nixpkgs>") " { };" n
> "python3 = pkgs." (p "python311Full") ";" n
> "extraPackages = with pkgs; [ uv poetry pre-commit " q " ];" n
"}")
python-base-mode
(aoc "EXAMPLE=\"\"\"" n
"\"\"\"" n n
"class " (p "MyClass" class) ":" n
> "def __init__(self, input: str) -> None:" n
> "self._input = input[1:]" n
> "return" n n
> "def __str__(self) -> str:" n
> "return f\"Part1: {self._part1}\\nPart2: {self._part2}\"" n n
> "@property" n
> "def _part1(self) -> int:" n
> "return None" n n
> "@property" n
> "def _part2(self) -> int:" n
> "return None" n n n
"if __name__ == \"__main__\":" n
> "example = " (s class) "(EXAMPLE)" n
> "print(example)")
;; Local Variables:
;; mode: lisp-data
;; outline-regexp: "[a-z]"
;; End: