I've been working with Apache Kafka for over 7 years. I inevitably find myself doing the same set of activities while I'm developing or working with someone else's system. Here's a set of Kafka productivity hacks for doing a few things way faster than you're probably doing them now. 🔥
Note: These workarounds covered issues in
lein-tools-deps
0.3.0-SNAPSHOT
. If using0.4.1
or later, you should not encounter the issues below.
The following provides some workarounds for some issues when using lein-tools-deps
from Cursive on macOS.
By default, the lein-tools-deps
plugin won't see /usr/local/bin/clojure
when Cursive processes project.clj
, as it evidently has a degenerate path.
You will see an error like the following in the IntelliJ Event Log when it tries to process your project.clj
file:
(ns net.thegeez.advent.spec-parsing | |
(:require [clojure.string :as str] | |
[clojure.spec :as s] | |
[clojure.spec.gen :as gen] | |
[clojure.test.check.generators :as tgen])) | |
;; Dependencies: | |
;; [org.clojure/clojure "1.9.0-alpha14"] | |
;; [org.clojure/test.check "0.9.0"] | |
;; Advent of Code is a series of code challenges in the form of an advent |
It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.
- Pfctl man page (apple.com)
- Pf.conf man page (apple.com)
- How to secure your Mac when using it on wireless networks (sarfata.org)
- Pf on OS X 10.7 (zomo.co.uk)
- OpenBSD packet filter (PF): Real life example (daemon-notes.com)
- Firewalling with OpenBSD's PF packet filter (rlworkman.net)
- PF (OpenBSD) (readthedocs.org)
- PF rules (kernel-panic.it)
These are for the combined vim-sexp
(https://github.com/guns/vim-sexp) and vim-sexp-mappings-for-regular-people
(https://github.com/tpope/vim-sexp-mappings-for-regular-people) plugins. vim-sexp
is neat on its own but Tim Pope makes common stuff much easier.
Note that some vim-sexp
functionality depends on <LocalLeader>
mappings. This is a different leader key than the global leader, and is the variable maplocalleader
(instead of mapleader
). To see if you have this set, use :echo maplocalleader
; if it errors out you'll need to set it, otherwise it will echo the key. If you want to set your LocalLeader
to <Space>
, you'll need two commands in your .vimrc
, since by default <Space>
is bound to <Right>
in normal mode:
nnoremap <Space> <Nop>
let maplocalleader=" "
--- Actions --- | |
$Copy <M-C> | |
$Cut <M-X> <S-Del> | |
$Delete <Del> <BS> <M-BS> | |
$LRU | |
$Paste <M-V> | |
$Redo <M-S-Z> <A-S-BS> | |
$SearchWeb <A-S-G> | |
$SelectAll <M-A> | |
$Undo <M-Z> |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
module Mongoid | |
module Document | |
def instantiate(attrs = nil, criteria_instance_id = nil) | |
attributes = attrs || {} | |
doc = allocate | |
doc.criteria_instance_id = criteria_instance_id | |
doc.instance_variable_set(:@attributes, attributes) | |
doc.apply_defaults | |
IdentityMap.set(doc) if identity_map_set_possible?(criteria_instance_id) | |
doc.run_callbacks(:initialize) unless doc._initialize_callbacks.empty? |
# Git pre-commit hook to check all staged Ruby (*.rb/haml/coffee) files | |
# for Pry binding references | |
# | |
# Installation | |
# | |
# ln -s /path/to/pre-commit.sh /path/to/project/.git/hooks/pre-commit | |
# | |
# Based on | |
# | |
# http://codeinthehole.com/writing/tips-for-using-a-git-pre-commit-hook/ |