Skip to content

Instantly share code, notes, and snippets.

@priyadarshan
priyadarshan / words
Created August 1, 2020 16:50 — forked from wchargin/words
/usr/share/dict/words
This file has been truncated, but you can view the full file.
A
A's
AA's
AB's
ABM's
AC's
ACTH's
AI's
AIDS's
AM's
(ql:quickload "cl-ppcre")
(ql:quickload "anaphora")
(defpackage :ini-parser
(:use :common-lisp :anaphora)
(:export :read-config-from-file))
(in-package :ini-parser)
(defparameter +empty-line+ (format nil "~%"))
@priyadarshan
priyadarshan / ntfs-filenames.txt
Created February 11, 2020 18:59 — forked from doctaphred/ntfs-filenames.txt
Invalid characters for Windows filenames
Information from https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx :
Use any character in the current code page for a name, including Unicode
characters and characters in the extended character set (128–255), except
for the following:
- The following reserved characters:
< (less than)
> (greater than)
@priyadarshan
priyadarshan / shell-script
Created February 11, 2020 18:59 — forked from doctaphred/shell-script
How to start every shell script, since I can never remember
#!/bin/sh -euvx
# -e If non interactive then exit immediately if a command fails.
# -u Treat unset variables as an error when substituting.
# -v Print shell input lines as they are read.
# -x Print commands and their arguments as they are executed.
@priyadarshan
priyadarshan / braille-pixels.lisp
Created November 17, 2019 18:36 — forked from Goheeca/braille-pixels.lisp
Braille pixels images using cl-charms (@ SBCL)
#!/usr/bin/sbcl --script
#|
Usage
=====
$ ./braille-pixels.lisp [path]
Main
====
@priyadarshan
priyadarshan / threads.lisp
Created November 17, 2019 18:35 — forked from Goheeca/threads.lisp
Bordeaux Threads test
(require :asdf)
(require :bordeaux-threads)
(defun color-formatter (color)
(format nil "~a[~am~~?~a[m" #\Esc color #\Esc)) ; The formatter function wants a simple-string.
(defun message (color i thread)
(let ((color-format (color-formatter color))
(thread-name (bt:thread-name thread)))
(format t "~&Hello for the ~? time from the ~? thread.~%"
@priyadarshan
priyadarshan / ob-powershell.el
Created October 22, 2019 11:07 — forked from cbilson/ob-powershell.el
Rough draft: execute poweshell from emacs src blocks
;;; ob-powershell.el --- org-babel functions for powershell evaluation
;; Authors: Chris Bilson
;; Keywords: literate programming, reproducible research
;; Homepage: http://orgmode.org
;;; Commentary:
;; Org-Babel support for evaluating powershell source code.
@priyadarshan
priyadarshan / eshell.org
Created August 28, 2019 15:41 — forked from ralt/eshell.org
my eshell config

Eshell

eshell is the shell I’ve tried using over time, and in the end just never stick with it. Let’s try one more time with a couple of tricks. The first tricks are mostly documentation:

  • M-& in a tramp-aware session means you run commands in a new buffer, without a TTY. Great for things like tailf.
  • for ncurses-like applications, “visual commands” is the missing context. Applications like top are in the default list by default,
@priyadarshan
priyadarshan / README.md
Created August 28, 2019 15:37 — forked from ralt/README.md
horse-html: extension to Parenscript

My main gripe with who-ps-html is that it generates a string, which means that you don't have a real DOM object to play with; you must wait to render that object before being able to do things on it.

horse-html fixes that by generating real DOM elements in JavaScript, and returning those.

The absolute best feature of horse-html is that the closures also magically work. If you define an onclick on an element, the JavaScript will use the closures generated wherever your code is defining that onclick attribute.

PS: the code can definitely be improved. I suck. But for the little use cases I have, it works. Feedback definitely welcome. I'm notably not a fan of the nested functions, but couldn't figure out a better way.

@priyadarshan
priyadarshan / slow.lisp
Created May 20, 2019 14:48 — forked from j3pic/slow.lisp
Program to test the performance of Lisp file I/O.
;; It is often said that Lisp macros need not be used for optimization purposes. This
;; is an exception. SBCL issued the following warning when compiling the MAKE-ARRAY call
;; below:
;; ; note: unable to optimize because: ELEMENT-TYPE is not constant.
;; I don't want to lose the ability to decide which ELEMENT-TYPE to use by using
;; an :ELEMENT-TYPE argument, so I have to arrange for this argument to be processed
;; at compile time.