Skip to content

Instantly share code, notes, and snippets.


Jeff Kreeftmeijer jeffkreeftmeijer

View GitHub Profile
jeffkreeftmeijer / XmlParser.h
Created Mar 15, 2012
Objective-C XML parser
View XmlParser.h
#import <Foundation/Foundation.h>
@interface XmlParser : NSObject <NSXMLParserDelegate>
@property (strong, nonatomic) NSData *xmlData;
@property (strong, nonatomic) NSMutableDictionary *dictionary;
@property (strong, nonatomic) NSMutableDictionary *currentNode;
@property (strong, nonatomic) NSMutableDictionary *currentParentNode;
- (id)initWithXMLData:(NSData *)xmlData;
View bang.gemspec do |s| = 'bang'
s.version = '0.1.0'
s.platform = Gem::Platform::RUBY = 'Jeff Kreeftmeijer' = ''
s.summary = 'Bang!'
s.description = 'Bangs existing model methods'
s.files = ['bang.rb']
View subshell.adoc


A subshell creates a separate instance of the command processor, or a subprocess of the parent shell. Although a subshell is started in its parent’s working directory, directory changes made within the subshell don’t carry over to its parent. This makes subshells ideal for running one-off commands in a different directory:

$ pwd
$ (cd www && npm install)
$ pwd
View vim-macros.adoc

Vim Macros

To record a macro, press q in normal mode, followed by a paste registry to store the macro in. To define a quick macro to use a couple of times, I usually use the q registry, meaning I type qq. Vim will tell you you’re currently recording a macro in the status line.

--recording @q

Vim will now record your commands to be used later. For example, to convert a markdown-style link ([Jeff Kreeftmeijer]( to an asciidoc-style one (Jeff Kreeftmeijer) one, the recorded macro looks like this [1]:


1. A subsitution might be a better fit for this specific case
View cargo-install-locked.adoc

cargo install --locked

While installing cargo-generate I ran into an error compiling caused by missing type annotations in cargo itself.


An already-closed issue in Cargo explained that the issue originated in the serde crate, and was already resolved. While waiting for a patched release, users were advised to use cargo install --locked.

View generate
ffmpeg -i -filter_complex "fps=10,scale=960:-1" nightfall.gif
View http_server.rb
require 'socket'
require 'rack'
require 'rack/lobster'
app =
server = 5678
while session = server.accept
request = session.gets
puts request
View communication-policy.adoc

Embrace email, mute Slack. A policy for handling incoming messages