Skip to content

Instantly share code, notes, and snippets.

@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)
@shawnma
shawnma / perm.py
Created October 23, 2018 03:16
permutations of words
import copy, sys
words = set()
def load():
for f in open('words.txt').readlines():
words.add(f.strip())
#
# sr - string
# all - output set
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
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
%YAML 1.2
---
name: pbascii
file_extensions: [pbascii]
scope: source.pbascii
contexts:
main:
- match: '"'
push: string
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