Skip to content

Instantly share code, notes, and snippets.

View freemo's full-sized avatar

Jeffrey Phillips Freeman freemo

View GitHub Profile
@freemo
freemo / Maven Release Plugin Commands.txt
Last active September 16, 2017 22:15
using maven release plugin
mvn release:clean
mvn release:prepare
mvn release:perform
@freemo
freemo / Check for Outdated Maven Dependencies & Plugins.txt
Last active September 16, 2017 22:15
What maven dependencies can be updated?
mvn versions:display-dependency-updates
mvn versions:display-plugin-updates
@freemo
freemo / TitanGods.java
Last active March 22, 2018 03:23
Example for working with TitanGraph
import com.thinkaurelius.titan.core.TitanFactory;
import com.thinkaurelius.titan.core.TitanGraph;
import com.thinkaurelius.titan.core.TitanKey;
import com.thinkaurelius.titan.core.attribute.Geoshape;
import com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration;
import com.tinkerpop.blueprints.Edge;
import com.tinkerpop.blueprints.Vertex;
import com.tinkerpop.blueprints.util.ElementHelper;
import org.apache.commons.configuration.BaseConfiguration;
import org.apache.commons.configuration.Configuration;
@freemo
freemo / limit-size.sh
Created November 1, 2014 07:11
A GIT hook for limiting the size of files committed to a repository.
#!/bin/sh
#echo ""
#echo "==== Remote update-hooks/file-hooks/limit-size.sh ===="
#Initialize
ref="$1"
old_rev="$2"
new_rev="$3"
@freemo
freemo / enforce-eol.sh
Created November 1, 2014 07:10
A GIT hook for enforcing EOL characters
#!/bin/sh
#echo ""
#echo "==== Remote update-hooks/file-hooks/enforce-eol.sh ===="
#Initialize
ref="$1"
old_rev="$2"
new_rev="$3"
@freemo
freemo / PrimeCheck.hs
Last active September 20, 2019 17:00
Primality Algoritm, Multiple languages
prime :: Int -> Bool
prime x
| x == 1 = False
| x == 2 = True
| x == 3 = True
| x `mod` 2 == 0 = False
| x `mod` 3 == 0 = False
| otherwise = all (\y -> x `mod` y /= 0) $ dividends x
where
dividends z =
@freemo
freemo / MergeSort.hs
Last active September 20, 2019 17:00
Merge sort, Multiple languages
mergeSort :: (Ord a) => [a] -> [a]
mergeSort x
| len <= 1 = x
| otherwise = combine (mergeSort upper) (mergeSort lower)
where len = length x
middle = quot len 2
upper = take middle x
lower = drop middle x
combine x [] = x
combine [] x = x