Skip to content

Instantly share code, notes, and snippets.

View navicore's full-sized avatar

Ed Sweeney navicore

View GitHub Profile
@navicore
navicore / unball.py
Created February 2, 2014 18:01
to unball a vim plugin
#!/usr/bin/python
#-*- coding:utf-8 -*-
# see http://forrst.com/posts/An_unball_script_for_vimball_plugins-CHM for
# author and credit of this code
import os, sys
if len(sys.argv) < 2:
raise SystemExit('Please specify a vba file (and optionally the directory to unball it to)')
" 1) install vundle:
" git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
" 2) restart vim
" 3) :BundleInstall
"set term=builtin_ansi
syntax on
:set nu
set nocompatible " be iMproved
@navicore
navicore / build.gradle
Created May 26, 2014 02:25
super jar with gradle
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'application'
version = '1.0'
repositories {
mavenCentral()
}
@navicore
navicore / consume_gram.sh
Last active August 29, 2015 14:01
bash to build classpath from directory of jars
#!/bin/sh
PROJECT_DIR="$(cd `dirname $0`; pwd)"
PROJECT_JAR="none"
for entry in "build/libs"/*
do
PROJECT_JAR=$entry
echo "running $entry"
break
@navicore
navicore / BuildPackage.sh
Last active August 29, 2015 14:01
Build an R package
#!/bin/sh
# requires R and latex / pdflatex
rm -rf ./mypkg/..Rcheck
cd ./mypkg
R CMD check .
cp ..Rcheck/mypkg-manual.pdf ..
rm -rf ..Rcheck
cd ..
@navicore
navicore / csvme.py
Created May 26, 2014 02:38
csv with python
#!/usr/bin/env python
import csv
with open('filename.csv', 'rb') as f:
reader = csv.reader(f)
for row in reader:
print "%s --- %s" % (row[0], row[1])
@navicore
navicore / 0_reuse_code.js
Created August 2, 2014 18:37
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@navicore
navicore / Phrases.md
Created August 2, 2014 19:15
Phrases
  • “Good jeux du mot” - good word game

  • Study history - it edifies us

" 1) install vundle:
" git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
" 2) restart vim
" 3) :BundleInstall
" 4) build ~/.vim/bundle/YouCompleteMe with './install.sh --clang-completer'
"set term=builtin_ansi
syntax on
:set nu
package fpscala
sealed trait List[+A]
case object Nil extends List[Nothing]
case class Cons[+A](head: A, tail: List[A]) extends List[A]
object List {
def sum(ints: List[Int]): Int = ints match {
case Nil => 0
case Cons(x,xs) => x + sum(xs)