Skip to content

Instantly share code, notes, and snippets.

View freemo's full-sized avatar

Jeffrey Phillips Freeman freemo

View GitHub Profile
@freemo
freemo / PerfectNumber.hs
Created February 25, 2018 10:19
Perfect Number in Haskell
let dividends y = tail [ quot x z | z <- [1..(floor (sqrt (fromIntegral y)))], x <- [y, z^2], (mod y z) == 0]
let perfect y = sum (dividends y) == y
let perfectlist z = [y | y <-[1..z], perfect y]
perfectlist 4
[1,6,28,496,8128]
@freemo
freemo / Script
Last active September 20, 2019 08:49
Remove ignored files in git
git clean -ndX #list files that would be removed
git clean -fdX #Actually remove them
@freemo
freemo / Git History Graph.sh
Last active September 13, 2017 02:15
Show history as graph in #git
git log --graph --full-history --all --color --pretty=format:"%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s"
@freemo
freemo / .zshenv
Last active February 3, 2023 02:20
Custom ZSH Prompt
if [[ "$SHLVL" -eq 1 && ! -o LOGIN && -s "${ZDOTDIR:-$HOME}/.zprofile" ]]; then
source "${ZDOTDIR:-$HOME}/.zprofile"
fi
@freemo
freemo / HyperassociativeMap.java
Last active April 12, 2017 15:42
Hyperassociative Map
/**
* A Hyperassociative Map is a new type of algorithm that organizes an arbitrary
* graph of interconnected nodes according to its associations to other nodes.
* Once a new Hyperassociative Map has been associated and aligned, nodes that
* are most closely associated will be closest to each other.
* For more info, please see the
* <a href ="http://wiki.syncleus.com/index.php/dANN:Hyperassociative_Map">
* Hyperassociative-Map dANN Wiki page</a>.
* @author Jeffrey Phillips Freeman
* @param <G> The graph type
@freemo
freemo / keybase.md
Created August 4, 2016 03:12
keybase identity verification.

Keybase proof

I hereby claim:

  • I am freemo on github.
  • I am freemo (https://keybase.io/freemo) on keybase.
  • I have a public key ASCk2DELJdA6Vm5uWDRrGXEGbl2K6ROCtnfN8vtt-U_j6Ao

To claim this, I am signing this object:

@freemo
freemo / script
Last active September 20, 2019 16:59
Colorized git contribotor log
git log --author=Freeman --format="%Cgreen%ci%Creset %s%Creset" > worklog.txt
@freemo
freemo / Run sonar through Maven..txt
Last active September 18, 2017 22:15
Updating sonar
mvn -Dmaven.test.failure.ignore=true clean org.jacoco:jacoco-maven-plugin:prepare-agent test jacoco:report verify sonar:sonar
@freemo
freemo / StringSimilarityUtils.java
Created June 10, 2015 20:17
A utility class that uses various methods to determine the similarity between two strings.
import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;
import java.util.List;
public final class StringSimilarityUtils {
private StringSimilarityUtils() {
throw new IllegalStateException("Should not be able to instantiate this class");
}
@freemo
freemo / .zshrc
Last active February 27, 2022 15:45
Customized ZSH prompt
# place this at ~/.zshrc
setfont sun12x22
zstyle ':completion:*' completer _complete _ignored
zstyle :compinstall filename '/home/freemo/.zshrc'
autoload -Uz compinit
compinit
# End of lines added by compinstall