Skip to content

Instantly share code, notes, and snippets.

@priyadarshan
priyadarshan / csplit.txt
Created September 28, 2018 08:56 — 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
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 / lobsters-mastodon.lisp
Created August 22, 2018 14:37 — forked from gkbrk/lobsters-mastodon.lisp
Common lisp Mastodon bot
(ql:quickload :drakma)
(ql:quickload :cl-json)
(ql:quickload :plump)
(ql:quickload :babel)
(ql:quickload :tooter)
(ql:quickload :split-sequence)
(defvar *feed-path* "https://lobste.rs/rss")
(setf drakma:*drakma-default-external-format* :UTF-8)
@priyadarshan
priyadarshan / cl-udpip.lisp
Created April 29, 2018 10:09 — forked from shortsightedsid/cl-udpip.lisp
Short guide to UDP/IP Client/Server programming in Common Lisp using usockets
; Short guide to UDP/IP Client/Server programming in Common Lisp using usockets
;
; The main reason for this guide is because there are very few examples that
; explain how to get started with socket programming with Common Lisp that I
; could understand.
; After working on a short example on TCP, I found the
; need for a UDP tutorial. So, here goes.
; As usual, we will use quicklisp to load usocket.
@priyadarshan
priyadarshan / cl-tcpip.lisp
Created April 29, 2018 10:08 — forked from shortsightedsid/cl-tcpip.lisp
Short guide to TCP/IP Client/Server programming in Common Lisp using usockets
; Short guide to TCP/IP Client/Server programming in Common Lisp using usockets
;
; The main reason for this guide is because there are very few examples that
; explain how to get started with socket programming with Common Lisp that I
; could understand. After spending a day trying, I finally came up with a small
; bit of code that makes it easy to understand the basics. I've written this
; primarily for myself, but should help others get started as well.
; As usual, we will use quicklisp to load usocket.
@priyadarshan
priyadarshan / ql-gitify.lisp
Created March 31, 2018 07:19 — forked from death/ql-gitify.lisp
Facilitate creating Git repositories for third-party Quicklisp projects.
(defpackage #:snippets/ql-gitify
(:documentation
"Facilitate creating Git repositories for third-party Quicklisp
projects.")
(:use #:cl)
(:import-from #:constantia #:out #:print-table)
(:import-from #:split-sequence #:split-sequence)
(:import-from #:alexandria #:starts-with-subseq #:hash-table-plist)
(:import-from #:ql #:qmerge)
(:export
@priyadarshan
priyadarshan / scratch.lisp
Created January 7, 2018 18:29 — forked from xach/scratch.lisp
Fitting a string into a predetermined width
;;;; scratch.lisp
(defpackage #:scratch
(:use #:cl #:vecto)
(:import-from #:zpb-ttf
#:xmin
#:xmax))
(in-package #:scratch)
@priyadarshan
priyadarshan / gist:68e37a8ec05c2474ce32ac1c7e1ad8c6
Created September 5, 2017 18:22 — forked from pvalkone/gist:9292589
How to set up IPMI Serial-Over-LAN (SOL) on a ASRock C2550D4I motherboard and FreeBSD 10.0-RELEASE
BIOS Setup
----------
1) Boot into the BIOS setup utility (press F2 or DEL) and open Advanced > Serial Port Console Redirection.
2) Disable COM1 and EMS console redirection and enable SOL redirection.
3) Set the SOL console redirection settings as follows:
Aptio Setup Utility - Copyright (C) 2012 American Megatrends, Inc.
Advanced
/----------------------------------------------------+-------------------------\
@priyadarshan
priyadarshan / CHANGES.md
Created September 4, 2017 15:13 — forked from mwpastore/00README.md
Lightning Fast WordPress: Caddy+Varnish+PHP-FPM

2017/03/17

  • Update Varnish service unit files to play nice with Varnish 5.x.

2017/02/02

  • Add more gzip-able content-types.
  • Add note about alternative to Varnish partitioning.

2017/01/30

@priyadarshan
priyadarshan / ox-wp-crayon.el
Created August 24, 2017 08:50 — forked from marcoimmel/ox-wp-crayon.el
org2blog: Wordpress crayon-plugin Backend for Org Export Engine
;;; ox-wp-crayon.el - Wordpress crayon-plugin Backend for Org Export Engine
;;; overrides org-wp-src-block function of org2blog / ox-wp package, https://github.com/punchagan/org2blog
;;; Copyright (C) 2017 [email protected]
;;; Version: 20170110-1
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
@priyadarshan
priyadarshan / ssl.rules
Created August 8, 2017 17:11 — forked from konklone/ssl.rules
nginx TLS / SSL configuration options for konklone.com
# Basically the nginx configuration I use at konklone.com.
# I check it using https://www.ssllabs.com/ssltest/analyze.html?d=konklone.com
#
# To provide feedback, please tweet at @konklone or email [email protected].
# Comments on gists don't notify the author.
#
# Thanks to WubTheCaptain (https://wubthecaptain.eu) for his help and ciphersuites.
# Thanks to Ilya Grigorik (https://www.igvita.com) for constant inspiration.
server {