Skip to content

Instantly share code, notes, and snippets.

View nicferrier's full-sized avatar

Nic Ferrier nicferrier

View GitHub Profile
(defmacro with-transient-file (file-name &rest code)
"Load FILE-NAME into a buffer and eval CODE.
Then dispose of the buffer.
File loading errors may be generated as by any call to visit a
file."
(declare (indent 1)
(debug (sexp &rest form)))
(let ((fvn (make-symbol "fv"))

the lean stack

what it is

nodejs

npm

mongodb

nginx

getting set up

installing node and mongo

set up a database

list data structures in emacs-lisp

lists

cover mapping separately

M-x package-install smartparens

`list’

`length’

`elt’

`cons’

`car’

`cdr’

@nicferrier
nicferrier / intro
Last active December 18, 2015 15:19 — forked from anonymous/intro
My friend has thought of a platform as a website which enables people wanting
to code on a project base. The creator of a project will outline it and start
work, where others may add lines of code for fun and for learning. We believe
it could bridge the gap between different competencies and also be a learning
arena. This is currently been started. will comence more on 21june.
(defun twaddle-log (con hdr data)
(with-current-buffer (get-buffer-create "*twitter-log*")
(insert (format "%s %S %s\n" con hdr data))))
;; OAuth header and signature implementation
(defun* twaddle|oauth1-header-do (url &key http-params method oauth-token)
"Private function implementing oauth header construction."
(let* ((oauth-params
`(("oauth_consumer_key" . ,twaddle-consumer-key)
- timer-event-handler 39716 90%
- byte-code 39704 90%
- apply 39704 90%
- sp-show--pair-function 39356 89%
- sp-get-thing 39354 89%
- sp-get-sexp 39322 89%
- sp-get-paired-expression 39318 89%
- sp--get-string-or-comment-bounds 39318 89%
- sp-get-quoted-string-bounds 39318 89%
- syntax-ppss 39023 89%
(defun nic-dyn-lookup (symbol)
(format "%S" (symbol-value (intern symbol))))
(defun nic-lex-lookup (symbol environment)
(let ((value (assq (intern symbol) (cadr environment))))
(when (consp value) (format "%S" (cdr value)))))
(defmacro s-lex-format (template)
(if lexical-binding
(let ((str "in my craft and sullen art"))
(save-match-data
(string-match "\\(in\\) my craft" str))
(let ((str2 (concat "" str)))
(string-match "thing1" str2)
(match-string 1 str2)))
;;; elnode-proxy.el -- proxying with elnode -*- lexical-binding: t -*-
(require 's)
(require 'web)
(defun elnode/web->elnode-hdr (hdr httpcon)
(apply
'elnode-http-start
httpcon 200
(mapcar
(require 'ert)
(require 'elwiki)
(require 'fakir)
(ert-deftest elwiki/render-page ()
"Test `elwiki/render-page'."
(fakir-mock-process :httpcon ()
(let ((elwiki-wikiroot "/path/to/wikiroot/")
(test-file-contents "= Test page =\nthis is a test wiki page\n")
(output ""))