Skip to content

Instantly share code, notes, and snippets.

@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 != ' ')
@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 / mvln
Created August 11, 2012 19:38
mvln
#!/usr/bin/env perl
=head1 NAME
mvln - move a file and leave a symlink to its new location in its place
=head1 SYNOPSIS
B<mvln> I<source> I<destination>
@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 / colortest.pl
Last active October 10, 2015 00:37
colortest
#!/usr/bin/env perl
#########################################################################
# Copyright (C) 2012 Wojciech Siewierski #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
@vifon
vifon / filebringer
Created September 2, 2012 20:28
filebringer
#!/bin/zsh
#########################################################################
# Copyright (C) 2012 Wojciech Siewierski #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
@vifon
vifon / dmenu_man
Last active December 27, 2015 07:49
#!/bin/zsh
#########################################################################
# Copyright (C) 2013 Wojciech Siewierski, Aleksander Nitecki #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
@vifon
vifon / dump_elka.sh
Created April 3, 2014 15:39
Warsaw University of Technology FEIT/WEiTI course dumper
#!/bin/zsh
#########################################################################
# Copyright (C) 2014 Wojciech Siewierski #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
@vifon
vifon / wicdctl
Last active August 29, 2015 14:11
Simple wicd-cli wrapper
#!/bin/zsh
zebra()
{
local r=0
while IFS='' read -r line; do
r=$((!r))
(( r )) && print -n '\e[1;34m'
print $line
(( r )) && print -n '\e[0m'
"add imports on the first line" in withAnalyzer { (dir, analyzerRef) =>
val file = srcFile(dir, "tmp-contents", contents(
"import scala.collection.mutable.Set"
), write = true, encoding = encoding)
val analyzer = analyzerRef.underlyingActor
val procId = 1
analyzer.handleRefactorPrepareRequest(
new PrepareRefactorReq(