Skip to content

Instantly share code, notes, and snippets.

@romanofski
romanofski / Makefile
Created August 27, 2012 22:11
romanofskis vimrc
_snippets: snippets
ln -s $(shell pwd)/$< $(HOME)/.vim/snippets
.vimrc: vimrc
mkdir -p $(HOME)/.vim
git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
ln -s $(shell pwd)/$< $(HOME)/$@
install: .vimrc snippets
vim +PluginInstall +qall
@romanofski
romanofski / zshrc
Created October 17, 2012 04:38
My ZSHRc
# The default hostname to display in the shell prompt. Maybe override this
# later for specific hosts.
# http://www.gentoo.org/doc/en/zsh.xml
# remove "/" from WORDCHARS to that path segments are considered as words
# when editing the command line.
DISABLE_AUTO_UPDATE="true"
WORDCHARS=${WORDCHARS:s@/@}
export ZSH=$HOME/.oh-my-zsh
# check if a mail has interesting content for me based on a keyword
# search
SHELL=/bin/sh
PATH="$HOME/bin:/usr/bin:/usr/local/bin:/usr/include:/usr/local/sbin:/bin:/sbin:/usr/sbin"
TESTDIR=/tmp/procmailtest
MAILDIR=${TESTDIR}
LOGFILE=${TESTDIR}/Proctest.log
LOGABSTRACT=all
VERBOSE=yes
@romanofski
romanofski / buildout.cfg
Created February 18, 2013 22:57
Plone 2 compatible buildout.cfg
[buildout]
find-links =
http://dist.plone.org
http://download.zope.org/ppix/
http://download.zope.org/distribution/
http://effbot.org/downloads
parts = zope2
instance
fixup
@romanofski
romanofski / linkProject.py
Created March 5, 2013 03:18
link a project folder
#!/usr/bin/env python
# Manages links to a project directory
import optparse
import os.path
import sys
DEFAULTHOME = os.path.join(os.environ['HOME'], 'projects')
@romanofski
romanofski / xmonad.hs
Created March 6, 2013 00:40
XMonad configuration
-- most things copied from:
-- http://haskell.org/haskellwiki/Xmonad/Config_archive/31d1's_xmonad.hs
import XMonad
import qualified XMonad.StackSet as W
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers
@romanofski
romanofski / post-checkout.sh
Created November 22, 2013 10:20
git post-checkout hook, which does $foo when you switch to a branch with a 'bug_XXXX' in the name.
#!/bin/bash
#
# Rename to `post-checkout`, make it executable and stick it into .git/hooks/
#
PREVIOUS_HEAD=$1
NEW_HEAD=$2
BRANCH_SWITCH=$3
NEW_BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [[ $NEW_BRANCH =~ bug_[[:digit:]]+ ]]
@romanofski
romanofski / nudge_challenge.md
Created December 6, 2013 02:30
BE101x Behavioural Economics in Action - Nudge Challenge

Background

An increasing part of the population is overweight and obese in Australia. Two main factors are the cause of this:

  • less physical exercise
  • more high-energy foods are consumed

I would like to concentrate in my nudge challenge of the food consumption

@romanofski
romanofski / traverse.hs
Created March 27, 2014 00:08
traversing method in haskell (errors included ;))
{-# LANGUAGE TemplateHaskell #-}
import Test.QuickCheck
import Test.QuickCheck.All
import Data.List
import Data.List.Split
--
-- since lists are homogenous, we'll need something which can resemble
-- a tree
--
@romanofski
romanofski / download.py
Created August 5, 2014 23:10
Follows links from a main page and downloads subsequent links config
#!/usr/bin/env /usr/bin/python3
#
# Follows links from a main page and downloads subsequent links config.
# The script was written for a specific site, so don't wonder why all
# selectors are hard coded.
#
from lxml import html
from lxml import etree
import requests
import sys