Most OpenStack modules have a global variable LOG
defined already, e.g. in Neutron:
from neutron.openstack.common import log
LOG = log.getLogger(__name__)
use prettyprint to format complex data structures
from pprint import pformat
(defadvice org-archive-subtree (around fix-hierarchy activate) | |
(let* ((fix-archive-p (and (not current-prefix-arg) | |
(not (use-region-p)))) | |
(afile (org-extract-archive-file (org-get-local-archive-location))) | |
(buffer (or (find-buffer-visiting afile) (find-file-noselect afile)))) | |
ad-do-it | |
(when fix-archive-p | |
(with-current-buffer buffer | |
(goto-char (point-max)) | |
(while (org-up-heading-safe)) |
Install Homebrew OS X package manager: | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
Install ffmpeg with x265 support: | |
brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-libass --with-libquvi --with-libvorbis --with-libvpx --with-opus --with-x265 | |
Convert video to x265: | |
ffmpeg -i input -c:v libx265 -preset medium -crf 28 -c:a aac -b:a 128k output.mp4 | |
Uninstall ffmpeg: |
;; org-archive-subtree-hierarchical.el | |
;; modified from https://lists.gnu.org/archive/html/emacs-orgmode/2014-08/msg00109.html | |
;; In orgmode | |
;; * A | |
;; ** AA | |
;; *** AAA | |
;; ** AB | |
;; *** ABA | |
;; Archiving AA will remove the subtree from the original file and create |
Note for newcomers: | |
In the shortcuts below, "C" stands for CTRL and "A" stands for "ALT". This is a convention | |
used in the Midnight Commander documentation and was kept here. | |
You can also use "ESC" instead of "ALT", which is useful on Macbooks. | |
Main View | |
--------------------------------------------------------------- | |
- File/directory operations |
// This will open up a prompt for text to send to a console session on digital ocean | |
// Useful for long passwords | |
(function () { | |
var t = prompt("Enter text to be sent to console, (This wont send the enter keystroke)").split(""); | |
function f() { | |
var character = t.shift(); | |
var i=[]; | |
var code = character.charCodeAt(); | |
var needs_shift = "!@#$%^&*()_+{}:\"<>?~|".indexOf(character) !== -1 |
Most OpenStack modules have a global variable LOG
defined already, e.g. in Neutron:
from neutron.openstack.common import log
LOG = log.getLogger(__name__)
use prettyprint to format complex data structures
from pprint import pformat
This post also appears on lisper.in.
Reader macros are perhaps not as famous as ordinary macros. While macros are a great way to create your own DSL, reader macros provide even greater flexibility by allowing you to create entirely new syntax on top of Lisp.
Paul Graham explains them very well in [On Lisp][] (Chapter 17, Read-Macros):
The three big moments in a Lisp expression's life are read-time, compile-time, and runtime. Functions are in control at runtime. Macros give us a chance to perform transformations on programs at compile-time. ...read-macros... do their work at read-time.
;;;; **deep binding** | |
;;; look up | |
(cdr (assq 'the-symbol *the-stack*)) | |
;;; funcall | |
; wind... | |
(loop for arg in args |
This playbook has been removed as it is now very outdated. |
As configured in my dotfiles.
start new:
tmux
start new with session name: