Skip to content

Instantly share code, notes, and snippets.

@cbilson
cbilson / ob-powershell.el
Created February 6, 2018 03:27
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.
(defpackage #:snippets/copy-directory
(:use #:cl)
(:import-from #:alexandria
#:copy-file)
(:import-from #:cl-fad
#:walk-directory
#:pathname-as-directory))
(in-package #:snippets/copy-directory)
@priyadarshan
priyadarshan / cl-sql.org
Last active January 23, 2018 16:23
cl-sql notes

Source: https://www.reddit.com/r/Common_Lisp/comments/7s53qi/what_do_you_recommend_to_work_with_sql_databases/dt2oeiu/

I’m no master and my snippets are in spanish, but basically… This is what you can do as quick examples of a way of using it, assuming you have loaded clsql and you have a connection to the db.

What you can do, that is, the pattern I suggest, is the following. For example you need to generate a SELECT statement for a specific purpose. You can define a macro like this (let’s suppose your select only needs to select for a specific column on a specific table):

(defmacro sql-select-document-numbers (&optional args)
 `(sql-operation 'select
                 (col :doc-num :ld)
@priyadarshan
priyadarshan / 1Some Unix Benchmarks
Last active February 5, 2018 07:40
Unix Benchmarks
s
@guicho271828
guicho271828 / case.lisp
Last active May 5, 2018 18:51
case -> jump table (see fcase8, fcase9)
#!/bin/sh
#|-*- mode:lisp -*-|#
#|
exec ros -Q -- $0 "$@"
|#
(progn ;;init forms
(ros:ensure-asdf)
#+quicklisp (ql:quickload '(:alexandria :trivia :iterate) :silent t))
(defpackage :ros.script.case.3724474528
@priyadarshan
priyadarshan / argo-first-dmesg.txt
Last active February 5, 2018 07:41
Argo first DMESG
Copyright (c) 1992-2017 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 11.1-RELEASE-p4 #0: Tue Nov 14 06:12:40 UTC 2017
[email protected]:/usr/obj/usr/src/sys/GENERIC amd64
FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on LLVM 4.0.0)
VT(efifb): resolution 1280x1024
CPU: AMD Ryzen Threadripper 1950X 16-Core Processor (3393.70-MHz K8-class CPU)
Origin="AuthenticAMD" Id=0x800f11 Family=0x17 Model=0x1 Stepping=1
(defun process(cells)
(do ((moves 0 (+ 1 moves))
(position 0))
((null (nth position cells)) (print moves))
(let ((pos (+ (parse-integer (nth position cells)) position)))
(setf (nth position cells) (write-to-string (+ (parse-integer (nth position cells)) 1)))
(setq position pos))))
(defun start()
(let (container)
@felipeochoa
felipeochoa / pp-debug.el
Last active November 19, 2021 19:59
Pretty print emacs debug frames
;;; pp-debug.el --- Pretty-printing debugger -*- lexical-binding: t -*-
;; Copyright (C) 2018 Felipe Ochoa
;; Author: Felipe Ochoa
;; Created: 5 Dec 2017
;; License: GPLv3
;;; Commentary:
;;; Pretty-print debugger frames.
@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

@eshamster
eshamster / create-alpha-map.ros
Last active January 1, 2018 16:31
Create an alpha map png from a png file
#!/bin/sh
#|-*- mode:lisp -*-|#
#| <Put a one-line description here>
exec ros -Q -- $0 "$@"
|#
(progn ;;init forms
(ros:ensure-asdf)
#+quicklisp (ql:quickload '(opticl cl-cli) :silent t))
(defpackage :ros.script.create-alpha-map.lisp.3711282690