Skip to content

Instantly share code, notes, and snippets.

Priyadarshan priyadarshan

Block or report user

Report or block priyadarshan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@priyadarshan
priyadarshan / ob-powershell.el
Created Oct 22, 2019 — forked from cbilson/ob-powershell.el
Rough draft: execute poweshell from emacs src blocks
View ob-powershell.el
;;; 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 Aug 28, 2019 — forked from ralt/eshell.org
my eshell config
View eshell.org

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 Aug 28, 2019 — forked from ralt/README.md
horse-html: extension to Parenscript
View README.md

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 / ccl.md
Last active Aug 26, 2019
class-v-struct.lisp CCL bench (Thinkpad x1 Extreme)
View ccl.md
? (load "/home/lisp/class-v-struct.lisp")
#P"C:/home/lisp/class-v-struct.lisp"
? (run-test-suite)

(LOOP FOR I FROM 1 TO RUN-TIMES DO (SET-RANDOM-CLASS MY-CLASS-INSTANCE))
took 72,604,000 microseconds (72.604000 seconds) to run.
During that period, and with 12 available CPU cores,
     72,593,750 microseconds (72.593750 seconds) were spent in user mode
              0 microseconds ( 0.000000 seconds) were spent in system mode
@priyadarshan
priyadarshan / lambda.txt
Created Jul 11, 2019
lambda.txt -- the ultimate fortune file
View lambda.txt
This is the file LAMBDA.TXT, version 11.
Last Edit: 2005-Sep-13
To install on systems using BSD fortune(6), rename this file "lambda" and
store it in the appropriate fortunes directory, usually /usr/games/fortune
or /usr/share/fortune or something like that. Then in that directory run
strfile(8) on the "lambda" file which should produce a "lambda.dat". To
test, go to some other directory with no file called "lambda" in it, and
say "fortune lambda". If you get a lispy fortune you win. If not you lose.
To install on other systems simply find a fortune program, install it, and
@priyadarshan
priyadarshan / slow.lisp
Created May 20, 2019 — forked from j3pic/slow.lisp
Program to test the performance of Lisp file I/O.
View slow.lisp
;; 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.
@priyadarshan
priyadarshan / plex-on-omnios-r151028-lx-zone.md
Last active May 30, 2019
Install Plex on OmniOS r151028 via lx zone
View plex-on-omnios-r151028-lx-zone.md
@priyadarshan
priyadarshan / csplit.txt
Created Sep 28, 2018 — forked from budparr/csplit.txt
Terminal command to split a list of markdown items into separate documents. Given a "slug" value, the file will be named that. You could also change slug to title and create slugs/filenames from the title. You may also want to run your output through a markdown converter, like https://github.com/domchristie/to-markdown
View csplit.txt
csplit -k -n 3 export.txt '/^@@@/' {'999'}; for i in xx*; do sed -i '' 's/@@@/---/g' $i; done; for i in xx*; do mv $i `egrep -m1 -e 'slug:.*' $i | sed -e s/[^\]\[A-Za-z0-9~.,_{}\(\)\'\-\+]/-/g -e s/slug--//`.md; done
@priyadarshan
priyadarshan / illumos-wipe-disk.sh
Last active Sep 7, 2018
illumos/OmniOS - Wipe disks in order to re-use them from previous zpool
View illumos-wipe-disk.sh
#!/usr/bin/ksh93
# This script only wipe same-sized disks for now
SIZE="10000831348736"
LAST_PART=`echo "($SIZE / 1024 / 1024) - 10" | /usr/bin/bc`
# List of disks to wipe
DRIVES="c0t5000CCA26BD0CAFAd0p0 c0t5000CCA26BD116ACd0p0 c0t5000CCA26BD59F6Dd0p0 c0t5000CCA26BD5AAC5d0p0
c0t5000CCA26BD6960Ed0p0 c0t5000CCA26BD6B9CCd0p0 c0t5000CCA26BD6C6D4d0p0 c0t5000CCA26BD6E59Cd0p0"
You can’t perform that action at this time.