Compare commits
31 commits
Author | SHA1 | Date | |
---|---|---|---|
|
f81d6ee7c9 | ||
c4c07fedfb | |||
|
dfc617a4b0 | ||
0e190fb9fb | |||
631727de3a | |||
52a26a76b5 | |||
a0b0f88a17 | |||
f629436460 | |||
e61b38b36c | |||
ec1bc84a26 | |||
201af79a42 | |||
56c3071d55 | |||
f0789a34ff | |||
31ec2ec412 | |||
9407acbc41 | |||
bf6c61336e | |||
ef7ef61ada | |||
9a1ae6d676 | |||
aee411ac47 | |||
8adf66a7fe | |||
175b4b1d70 | |||
52c3f91d82 | |||
3cf13265b8 | |||
5aa31f96ca | |||
765c869942 | |||
4b737d59dc | |||
35fd6ce31a | |||
dd0b684dc5 | |||
480b1bdef0 | |||
ce3cd3fb7e | |||
4775a1f5e2 |
10 changed files with 1616 additions and 1080 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -5,4 +5,6 @@
|
||||||
!early-init.el
|
!early-init.el
|
||||||
!init.org
|
!init.org
|
||||||
!README.org
|
!README.org
|
||||||
!.gitignore
|
!.gitignore
|
||||||
|
!snippets
|
||||||
|
!snippets/**
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
;;
|
;;
|
||||||
;; it is possible there are more so probably the most recent one is the one to use.
|
;; it is possible there are more so probably the most recent one is the one to use.
|
||||||
|
|
||||||
(setq elpaca-core-date "20241111")
|
(when emacs-build-time
|
||||||
|
(setq elpaca-core-date (format-time-string "%Y%m%d" emacs-build-time)))
|
||||||
(defvar elpaca-installer-version 0.8)
|
(defvar elpaca-installer-version 0.8)
|
||||||
(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory))
|
(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory))
|
||||||
(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory))
|
(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory))
|
||||||
|
|
115
org-generate.org
Normal file
115
org-generate.org
Normal file
|
@ -0,0 +1,115 @@
|
||||||
|
#+TITLE: Org Generate Boilerplate Templates
|
||||||
|
|
||||||
|
* Introduction
|
||||||
|
|
||||||
|
This document contains boilerplate templates for generating stuff.
|
||||||
|
|
||||||
|
To use use ~M-x org-generate~ and select the template you want to
|
||||||
|
generate.
|
||||||
|
|
||||||
|
Templates start at level 2. Specify the root folder for the generated
|
||||||
|
files.
|
||||||
|
|
||||||
|
Headings with a "/" at the end signify folders to be created to add
|
||||||
|
additional files into.
|
||||||
|
|
||||||
|
You can define variables and use them in the templates using the
|
||||||
|
typical mustache syntax {{variable}}. Variables are defined in the
|
||||||
|
~org-generate-variable~ property in the properties drawer of the the
|
||||||
|
template subtree.
|
||||||
|
|
||||||
|
*IMPORTANT* The code relies on ~#+begin_src~ and ~#+end_src~ blocks to be
|
||||||
|
written in lower case. The code looks for these case sensitively.
|
||||||
|
|
||||||
|
* aoc
|
||||||
|
** common-lisp
|
||||||
|
:PROPERTIES:
|
||||||
|
:org-generate-root: ~/quicklisp/local-projects/aoc
|
||||||
|
:org-generate-variable: year day
|
||||||
|
:END:
|
||||||
|
|
||||||
|
*** src/
|
||||||
|
**** {{year}}/
|
||||||
|
***** day{{day}}.lisp
|
||||||
|
#+begin_src common-lisp
|
||||||
|
|
||||||
|
(defpackage :aoc/2024/{{day}}
|
||||||
|
(:use :cl :aoc :alexandria :trivia :lla)
|
||||||
|
(:export
|
||||||
|
#:sample-data
|
||||||
|
#:sample-data2
|
||||||
|
#:part1
|
||||||
|
#:part2
|
||||||
|
))
|
||||||
|
|
||||||
|
(in-package :aoc/2024/{{day}})
|
||||||
|
|
||||||
|
|
||||||
|
(defun parse-line (line)
|
||||||
|
line)
|
||||||
|
|
||||||
|
|
||||||
|
(defun parse-input (lines)
|
||||||
|
(mapcar #'parse-line lines))
|
||||||
|
|
||||||
|
(defparameter input-text (test-input 2024 {{day}}))
|
||||||
|
(defparameter input-data (parse-input input-text))
|
||||||
|
|
||||||
|
(defparameter sample-text (aoc:split-lines ""))
|
||||||
|
(defparameter sample-data
|
||||||
|
(parse-input sample-text))
|
||||||
|
|
||||||
|
(defun part1 (data)
|
||||||
|
(length data))
|
||||||
|
|
||||||
|
(defun part2 (data)
|
||||||
|
(length data))
|
||||||
|
|
||||||
|
(defun solve-day ()
|
||||||
|
(format t "part1: ~A~%" (part1 input-data))
|
||||||
|
(format t "part2: ~A~%" (part2 input-data)))
|
||||||
|
|
||||||
|
(defun submit ()
|
||||||
|
(let ((p1 (part1 input-data))
|
||||||
|
(p2 (part2 input-data)))
|
||||||
|
(if p1 (submit-part1 {{year}} {{day}} p1))
|
||||||
|
(if p2 (submit-part2 {{year}} {{day}} p2))))
|
||||||
|
#+end_src
|
||||||
|
*** tests/
|
||||||
|
**** {{year}}/
|
||||||
|
***** day{{day}}-test.lisp
|
||||||
|
#+begin_src common-lisp
|
||||||
|
(defpackage :aoc/2024/{{day}}/tests
|
||||||
|
(:use :cl :aoc :aoc/tests :aoc/2024/tests :parachute :aoc/2024/{{day}}))
|
||||||
|
|
||||||
|
(in-package :aoc/2024/{{day}}/tests)
|
||||||
|
|
||||||
|
(define-test suite-2024-{{day}}
|
||||||
|
;:parent suite-2024
|
||||||
|
)
|
||||||
|
|
||||||
|
(define-test test-foo
|
||||||
|
:parent suite-2024-{{day}}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
(define-test test-bar
|
||||||
|
:parent suite-2024-{{day}}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
(define-test+run test-part1
|
||||||
|
:parent suite-2024-{{day}}
|
||||||
|
(is equal nil (part1 sample-data)))
|
||||||
|
|
||||||
|
(define-test+run test-part2
|
||||||
|
:parent suite-2024-{{day}}
|
||||||
|
(is equal nil (part2 sample-data)))
|
||||||
|
|
||||||
|
|
||||||
|
(defun run-tests ()
|
||||||
|
(run-test-suite 'suite-2024-{{day}}))
|
||||||
|
|
||||||
|
#+end_src
|
||||||
|
|
7
snippets/go-ts-mode/if-err
Normal file
7
snippets/go-ts-mode/if-err
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: if-err
|
||||||
|
# key: ife
|
||||||
|
# --
|
||||||
|
if err != nil {
|
||||||
|
$0
|
||||||
|
}
|
55
snippets/markdown-mode/specc
Normal file
55
snippets/markdown-mode/specc
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: specc
|
||||||
|
# key: specc
|
||||||
|
# --
|
||||||
|
# $1 Specification Template
|
||||||
|
> Ingest the information from this file, implement the Low-Level Tasks, and generate the code that will satisfy the High and Mid-Level Objectives.
|
||||||
|
|
||||||
|
## High-Level Objective
|
||||||
|
|
||||||
|
- [High level goal goes here - what do you want to build?]
|
||||||
|
|
||||||
|
## Mid-Level Objectives
|
||||||
|
|
||||||
|
- [List of mid-level objectives - what are the steps to achieve the high-level objective?]
|
||||||
|
- [Each objective should be concrete and measurable]
|
||||||
|
- [But not too detailed - save details for implementation notes]
|
||||||
|
|
||||||
|
## Implementation Notes
|
||||||
|
- [Important technical details - what are the important technical details?]
|
||||||
|
- [Dependencies and requirements - what are the dependencies and requirements?]
|
||||||
|
- [Coding standards to follow - what are the coding standards to follow?]
|
||||||
|
- [Other technical guidance - what are other technical guidance?]
|
||||||
|
|
||||||
|
## Context
|
||||||
|
|
||||||
|
### Beginning context
|
||||||
|
- [List of files that exist at start - what files exist at start?]
|
||||||
|
|
||||||
|
### Ending context
|
||||||
|
- [List of files that will exist at end - what files will exist at end?]
|
||||||
|
|
||||||
|
## Low-Level Tasks
|
||||||
|
> Ordered from start to finish
|
||||||
|
|
||||||
|
1. [First task - what is the first task?]
|
||||||
|
```aider
|
||||||
|
What prompt would you run to complete this task?
|
||||||
|
What file do you want to CREATE or UPDATE?
|
||||||
|
What function do you want to CREATE or UPDATE?
|
||||||
|
What are details you want to add to drive the code changes?
|
||||||
|
```
|
||||||
|
2. [Second task - what is the second task?]
|
||||||
|
```aider
|
||||||
|
What prompt would you run to complete this task?
|
||||||
|
What file do you want to CREATE or UPDATE?
|
||||||
|
What function do you want to CREATE or UPDATE?
|
||||||
|
What are details you want to add to drive the code changes?
|
||||||
|
```
|
||||||
|
3. [Third task - what is the third task?]
|
||||||
|
```aider
|
||||||
|
What prompt would you run to complete this task?
|
||||||
|
What file do you want to CREATE or UPDATE?
|
||||||
|
What function do you want to CREATE or UPDATE?
|
||||||
|
What are details you want to add to drive the code changes?
|
||||||
|
```
|
7
snippets/org-mode/elisp source block
Normal file
7
snippets/org-mode/elisp source block
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: source block emacs-lisp
|
||||||
|
# key: <se
|
||||||
|
# --
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
$0
|
||||||
|
#+END_SRC
|
7
snippets/org-mode/org title
Normal file
7
snippets/org-mode/org title
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name Org Mode Title
|
||||||
|
# key: ttl
|
||||||
|
# --
|
||||||
|
#+TITLE: $1
|
||||||
|
|
||||||
|
* $0
|
7
snippets/org-mode/short-babel-source-block
Normal file
7
snippets/org-mode/short-babel-source-block
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: short babel source block
|
||||||
|
# key: <s
|
||||||
|
# --
|
||||||
|
#+BEGIN_SRC $1
|
||||||
|
$0
|
||||||
|
#+END_SRC
|
11
snippets/org-mode/use-package source block
Normal file
11
snippets/org-mode/use-package source block
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: use package source block
|
||||||
|
# key: <sup
|
||||||
|
# --
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(use-package $1
|
||||||
|
:ensure t
|
||||||
|
:config
|
||||||
|
(progn
|
||||||
|
$0))
|
||||||
|
#+END_SRC
|
Loading…
Reference in a new issue