Skip to content

Instantly share code, notes, and snippets.

@fletch
fletch / foo.clj
Last active May 17, 2016 19:31
weasel incantation
;;; old
(require 'weasel.repl.websocket)
(cemerick.piggieback/cljs-repl (weasel.repl.websocket/repl-env))
;;; 20160517
(use 'figwheel-sidecar.repl-api)
(start-figwheel!)
(cljs-repl)
@fletch
fletch / yas-company-helm.el
Last active April 24, 2019 06:31
Yasnippet + company + helm
;; http://emacs.stackexchange.com/questions/10431/get-company-to-show-suggestions-for-yasnippet-names
;; Add yasnippet support for all company backends
;; https://github.com/syl20bnr/spacemacs/pull/179
(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)))
backend
(append (if (consp backend) backend (list backend))
@fletch
fletch / .ctags
Last active September 14, 2015 19:05
Readonly::Foo and use constant support for 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
fletch / sample-helm-file.el
Last active August 29, 2015 14:26
helm file source sample
(helm :sources
(helm-build-in-file-source
"dirtest" (expand-file-name "~/.dirs")
:candidate-transformer
(lambda (strs)
(mapcar
(lambda (str)
(destructuring-bind (name dir)
(s-split "=" str)
(cons name dir)))
@fletch
fletch / sauron_msg
Last active August 29, 2015 14:24
shell function sending messages to sauron using dbus
# -*- 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
@fletch
fletch / 2num.pl
Created September 10, 2009 19:42
#!/opt/local/bin/perl
##
## Slightly more idiomatic and optimized Perl of 2num.pl from
## http://github.com/brendano/awkspeed/tree/master
##
use strict;
use warnings;
open( my $vocab_fh, '>', "vocab" ) or die "vocab: $!\n";