Skip to content

Instantly share code, notes, and snippets.

@c00kiemon5ter
c00kiemon5ter / Makefile
Created September 21, 2013 17:46
convert a git repo to svn and backwards
# convert a git repo to svn or, an svn repo to git
# - git-core/git, subversion/svn and subgit ver 2.x.x should be installed
# - when converting from git to svn, a git-bare repo will be created
#
# HOW TO USE
# invoke make giving the appropriate target for the conversion and
# also definig the REPO variable that represents the repository name.
# do _not_ insert a leading / when specifying the repository name!
# example #1: make REPO=/path/to/some/git/repo svn
# example #2: make REPO=/path/to/some/svn/repo git
@c00kiemon5ter
c00kiemon5ter / zorba
Last active December 23, 2015 10:19
oXygen XML custom engine - using zorba
zorba -i -f -q "${xsl}" -o "${out}"
@c00kiemon5ter
c00kiemon5ter / xqilla
Last active December 23, 2015 10:19
oXygen XML custom engine - using xqilla
xqilla -i "${xmlu}" -o "${out}" "${xsl}"
@c00kiemon5ter
c00kiemon5ter / BaseX (standalone)
Last active December 23, 2015 08:29
oXygen XML custom engine - using BaseX
java -cp "${oxygenInstallDir}"/lib/BaseX.jar org.basex.BaseX -w -i "${xmlu}" -o "${out}" "${xsl}"
@c00kiemon5ter
c00kiemon5ter / segs.c
Created March 20, 2013 12:34
Given a sequence of length N, find the number of segments needed to divide the sequence in groups of K, where each group overlaps with the next.
/* cc -lm segs.c -o segs */
/* Problem:
*
* Given a sequence of length N, find the number of
* segments needed to divide the sequence in groups
* of K, where each group overlaps with the next.
*
* e.g., Given the sequence 1,2,3,4,5,6,7,8,9 of length 9
* when divided in groups of 3 will become:
@c00kiemon5ter
c00kiemon5ter / sic.sh
Created January 10, 2013 16:59
iii alike frontend for sic
#!/usr/bin/env sh
: "${c:=12}" # max channel width
: "${n:=12}" # max user name width
: "${p:=1}" # prettify - colors and stuff
: "${w:=110}" # max mesg width
: "${s:="|"}" # the separator
trap "stty '$(stty -g)'; kill -TERM 0" EXIT
stty -echonl -echo
@c00kiemon5ter
c00kiemon5ter / sys_monitor
Last active December 10, 2015 16:38
working on a script asked by @kuraku on [arch forums](https://bbs.archlinux.org/viewtopic.php?pid=1213820#p1213820)
#!/usr/bin/env bash
# Status script
# original: https://bitbucket.org/jasonwryan/eeepc/src/fefeccd4b280/Scripts/dwm-status
# colours: 01:normal 02:green 03:orange 04:red 05:gray 06:blue
## sleep interval - delay between updates
declare -r interval=3
## color definitions
@c00kiemon5ter
c00kiemon5ter / nwm.c
Created January 3, 2013 00:14
the non window manager in 9 lines of code
/* under cookie license -- all cookies (C) reserved
* contact c00kiemon5ter on freenode
*
* build
* -----
* make nwm CFLAGS="-std=c99 -Wall -Wextra -pedantic -Os -lX11" LDFLAGS="-s"
*
* usage
* -----
* setup your ~/.xinitrc and startx
@c00kiemon5ter
c00kiemon5ter / res_name.diff
Created October 1, 2012 14:46
patch to allow the configuration of the instance name of xtmux window on the command line
diff --git a/tmux.c b/tmux.c
index 5d82ff5..3331f67 100644
--- a/tmux.c
+++ b/tmux.c
@@ -52,6 +52,7 @@ pid_t environ_pid = -1;
int environ_idx = -1;
#ifdef XTMUX
char *xdisplay = NULL;
+char *res_name = NULL;
#endif
@c00kiemon5ter
c00kiemon5ter / scratchpad.sh
Created September 13, 2012 16:47
script to toggle visibility of a terminal
#!/bin/sh
name="scratchpad"
class="URxvt"
# print the window id of the window with the given
# instance name as the first argument '$1' and
# class name as the second argument '$2'
get_win_id() {
xwininfo -root -children -int | awk -v n="$1" -v c="$2" '$3 == "(\""n"\"" && $4 == "\""c"\")" { print $1 }'