Skip to content

Instantly share code, notes, and snippets.

  • NerdTree: Display your file system as a tree, enabling you to easily explore and open various files and directories.
  • NerdCommenter: Easily toggle the comment status of various amounts of code based on your key mappings.
  • Snipmate: Glide through often-typed code, or snippets, that you can quickly insert into your file. Update variables as you type.
  • Ctrl-P: Find full paths to files, buffers, and tags. Open multiple files at once and create new files or directories.
  • Syntastic: Check your syntax and be notified about errors before compiling your code or executing your script. http://www.hostingadvice.com/blog/vim-creator-champions-charityware/

Profiles

http://unix.stackexchange.com/a/117470

Eval

Oh, hells no! Never, and I mean NEVER, use eval for something as trivial as this. Indeed, you should only very rarely need it at all. It can be quite a security risk, and is almost never really necessary in general scripting.

Eval command and security issues

@gphilipp
gphilipp / events.cljs
Last active December 6, 2016 19:35
async issue
(reg-event-fx
:firebase/listen
(fn [{:keys [db] :as cofx} event]
(let [user (:user db)
firebase-database (:firebase-database db)]
; fetch user (core.async version)
(take! (-> firebase-database
(.ref)
(m/get-in [:user user])
(defn parse-csv
"Reads a text in CSV format into an edn format"
[csv-text]
(let [csv (csv/read-csv csv-text)
header-row (first csv)
rows (rest csv)]
(->> header-row
(map keywordize)
vec
(conj (map #(map parse-csv-value %) rows))
#!/usr/bin/env boot
(require '[clojure.string :as s])
(defn print-properties [[k v]]
(str k "=" v "\n"))
(defn print-component [component-name props]

Write Doc

GitBook

https://news.ycombinator.com/item?id=11933276 Use Gitbook. It kicks all kinds of ass, is easy, and has online editor, offline editor, and cli toolchain if needed.

No way. First, it has to be hosted in house. Second, that's basically the same markdown + pandoc I use for free already. Except it's even less flexible, and costs money. If API documentation would be just an ordinary book, I wouldn't have the urge to change anything, as pandoc + custom CSS actually does fine. Generating HTML + TOC from a bunch of .md files isn't really a problem, you know, it just isn't what makes writing API docs painful. I have a couple of sentences to say about every RPC call, maybe. It's actually mostly about providing huge (so, I guess foldable) params/result examples and making it easier to change the docs when the code changes. See Slate for example. Or even readthedocs. Both are not even remotely perfect, but are wa-ay more suitable for writing docs than gitbook.

ReStructured vs Markdown

@gphilipp
gphilipp / rabbit-event-log.md
Last active September 16, 2016 12:55
Rabbit as an Event Log

Since the new persister arrived in RabbitMQ 2.0.0 (yes, it's not so new anymore), Rabbit has had a relatively good story to tell about coping with queues that grow and grow and grow and reach sizes that preclude them from being able to be held in RAM

http://www.rabbitmq.com/blog/2011/10/27/performance-of-queues-when-less-is-more/

  • new persister
  • the volume of messages rabbit can hold on to is bounded by disk space (in previous versions it was bounded by memory)
  • rabbit optimises memory usage by paging messages out to / in from disk as needed