Skip to content

Instantly share code, notes, and snippets.

@vifon
vifon / Makefile
Created August 20, 2012 20:07
File Access Monitor
CFLAGS=-O2 -Wall -Wextra
.PHONY: all
all: accessmonitor.so
accessmonitor.so: accessmonitor.c
$(CC) $(CFLAGS) -fPIC -shared -ldl $< -o $@
@vifon
vifon / mvln
Created August 11, 2012 19:38
mvln

NAME

mvln - move a file and leave a symlink to its new location in its place

SYNOPSIS

mvln source destination

@vifon
vifon / git-fixup
Last active October 7, 2015 16:47
git fixup
#!/bin/sh
# USAGE: git fixup [commit hash or something]
# Adds the staged changes to the specified commit.
if [ -n "$1" ]; then
git stash --keep-index
git commit --fixup="$1" &&
GIT_EDITOR=vim git rebase --autosquash --interactive "$1~1"
git stash pop
@vifon
vifon / hist_accept_space.patch
Created June 8, 2012 19:36
zsh, histacceptspace patch
diff --git a/Src/hist.c b/Src/hist.c
index 4d522dd..78a98ed 100644
--- a/Src/hist.c
+++ b/Src/hist.c
@@ -1122,6 +1122,9 @@ should_ignore_line(Eprog prog)
if (isset(HISTIGNORESPACE)) {
if (*chline == ' ' || aliasspaceflag)
return 1;
+ } else if (isset(HISTACCEPTSPACE)) {
+ if (*chline != ' ')