Skip to content

Instantly share code, notes, and snippets.

fletch / foo.clj
Last active May 17, 2016
weasel incantation
View foo.clj
;;; old
(require 'weasel.repl.websocket)
(cemerick.piggieback/cljs-repl (weasel.repl.websocket/repl-env))
;;; 20160517
(use 'figwheel-sidecar.repl-api)
fletch / yas-company-helm.el
Last active Apr 24, 2019
Yasnippet + company + helm
View yas-company-helm.el
;; Add yasnippet support for all company backends
(defvar company-mode/enable-yas t
"Enable yasnippet for all backends.")
(defun company-mode/backend-with-yas (backend)
(if (or (not company-mode/enable-yas) (and (listp backend) (member 'company-yasnippet backend)))
(append (if (consp backend) backend (list backend))
fletch / .ctags
Last active Sep 14, 2015
Readonly::Foo and use constant support for ctags
View .ctags
--regex-perl=/Readonly::[a-zA-Z0-9_]+ my [\$@%]([a-zA-Z0-9_]+)/\1/C,Readonly:: constant/
--regex-perl=/use constant ([A-Z][a-zA-Z0-9_]+)/\1/c,use constant/
--regex-perl=/has[[:space:]]+([[:alnum:]_]+)[[:space:]]*=>/\1/M,moose attribute/e
fletch / sample-helm-file.el
Last active Aug 29, 2015
helm file source sample
View sample-helm-file.el
(helm :sources
"dirtest" (expand-file-name "~/.dirs")
(lambda (strs)
(lambda (str)
(destructuring-bind (name dir)
(s-split "=" str)
(cons name dir)))
fletch / sauron_msg
Last active Aug 29, 2015
shell function sending messages to sauron using dbus
View sauron_msg
# -*- sh -*-
sauron () {
local opt_f=zsh opt_S=3 action=AddMsgEvent
local myname=${(%):-%N}
local -a extra_args
while getopts "S:f:u:" opt; do
if [[ $opt = "?" ]]; then
print -r -- "$myname: unrecognized option: -$OPTARG" >&2
return 1
## Slightly more idiomatic and optimized Perl of from
use strict;
use warnings;
open( my $vocab_fh, '>', "vocab" ) or die "vocab: $!\n";