Skip to content

Instantly share code, notes, and snippets.

class EnhancedVertex {
static void setOrRemoveProperty(final Vertex self, final String property, final def value) {
if (value == null) self.removeProperty(property) else self.setProperty(property, value)
}
}
g = TinkerGraphFactory.createTinkerGraph()
use (EnhancedVertex) {
marko = g.v(1)
@timjstewart
timjstewart / overview
Last active December 27, 2015 19:39
Bash script that does high level analysis of Python, Java, and Scala source files
#! /bin/bash
#
# overview -- searches through all Java, Python, and Scala files in the current
# directory and all subdirectories and lists some basic stats about
# each file
if [ "$1" == "--help" ]
then
cat <<-HERE >&2
usage: overview [--help]
@timjstewart
timjstewart / Main.scala
Created November 7, 2013 05:49
Fun with RxScala (FRP)
package com.timjstewart
import scala.concurrent._
import rx.lang.scala._
object Main extends App {
override def main(args: Array[String]): Unit = {
def observable(n: Int) = Observable[Int] {