hello.spec:
Name: hello
Version: 2.10
Release: %autorelease
Summary: Produces a familiar, friendly greeting
License: GPL-3.0-or-later
URL: https://www.gnu.org/software/hello/
(cffi:defcfun ("fnmatch" fnmatch) :int | |
(pattern :string) | |
(string :string) | |
(flags :int)) | |
(defun glob-match (pattern string &optional (flags 4)) | |
(= 0 (fnmatch pattern string flags))) |
(set-macro-character | |
#\~ | |
(lambda (stream char) | |
(declare (ignore char)) | |
`(list ,@(read stream t)))) | |
;; USAGE: | |
(macroexpand (quote ~(1 2 3))) | |
;; => (LIST 1 2 3) |
#include <stdio.h> | |
#include <glib.h> | |
int main(int argc, char *argv[]) | |
{ | |
/* Linked List demo */ | |
GList *list = NULL; | |
list = g_list_append(list, "Hello world!"); | |
list = g_list_append(list, "Bye world!"); |
;;; gpt.el -*- lexical-binding: t; -*- | |
(defgroup ollama nil | |
"Ollama client for Emacs." | |
:group 'ollama) | |
(defcustom ollama:endpoint "http://192.168.68.108:11434/api/generate" | |
"Ollama http service endpoint." | |
:group 'ollama | |
:type 'string) |
;; help load config files (convenience function for my Doom setup, change for other distros) | |
(defun config-path (path) | |
(concat doom-user-dir path)) | |
;; runs clang-format with a specified config file | |
(defun clang-format-with-spec (spec) | |
(shell-command | |
(concat "clang-format" | |
" --style=file:" spec | |
" -i " buffer-file-name))) |
## | |
# Project Title | |
# | |
# @file | |
# @version 0.1 | |
CC=gcc | |
CFLAGS=-g -Wall | |
PROGNAME=CHANGEME |
; depends on alexandria | |
; memoizes int->int functions in a mutable vec | |
(defmacro defmemo/int->int (size name (in) &body body) | |
(let ((memo-name (read-from-string (format nil "~a-memo" name)))) | |
`(progn (defvar ,memo-name (make-array (+ 1 ,size) :initial-element nil)) | |
(defun ,name (,in) | |
(if-let ((memo (aref ,memo-name ,in))) | |
memo | |
(setf (aref ,memo-name ,in) (progn ,@body))))))) |
(defpackage workers | |
(:use :cl) | |
(:export #:list->simple-cqueue | |
#:simple-cqueue->list | |
#:join-workers | |
#:join-consumers | |
#:wmap | |
#:wfilter | |
#:wforeach)) |
(module (web globby) (globby->regexpstr globby->regexp globby-match) | |
(import (garlic base) regex) | |
;; made this since the one in `regex` egg doesnt support globstar | |
(define (globby->regexpstr glob) | |
"Only supports | ? * **" | |
;; mutable variable to dedupe globstars, sorry | |
(define ignoring-stars #f) |