Instantly share code, notes, and snippets.

View xls2csv.groovy
@Grab("org.apache.poi:poi-ooxml:3.13")
@Grab("org.apache.poi:poi:3.13")
@Grab("com.opencsv:opencsv:3.8")
@GrabExclude('stax:stax-api:')
import com.opencsv.*
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
String file = args[0]
def book = new XSSFWorkbook(file)
View perm.py
import copy, sys
words = set()
def load():
for f in open('words.txt').readlines():
words.add(f.strip())
#
# sr - string
# all - output set
View .tmux.conf
set -g prefix C-a
unbind-key C-b
bind-key C-a send-prefix
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
View soduku
from copy import copy
from operator import itemgetter
def weigh(arr):
wx = [0,0,0,0,0,0,0,0,0]
wy = copy(wx)
wb = copy(wx)
for i in range(0,9):
for j in range(0,9):
wx[i] += 1 if arr[i][j] != '.' else 0
View pbascii.sublime-syntax.yaml
%YAML 1.2
---
name: pbascii
file_extensions: [pbascii]
scope: source.pbascii
contexts:
main:
- match: '"'
push: string
View .vimrc
set hls
syntax on
au BufNewFile,BufRead *.gradle setf groovy
au BufRead,BufNewFile *.md set syntax=markdown
autocmd Filetype gitcommit setlocal spell textwidth=72
set ts=4 et
highlight ExtraWhitespace ctermbg=darkyellow guibg=red
set guifont=Inconsolata:h18
match ExtraWhitespace /\t/
se nocompatible