Skip to content

Instantly share code, notes, and snippets.

Avatar
🎧
Focusing

Greg greggigon

🎧
Focusing
View GitHub Profile
View keybase.io
### Keybase proof
I hereby claim:
* I am greggigon on github.
* I am greggigon (https://keybase.io/greggigon) on keybase.
* I have a public key ASDtjJuwVD6l31r9qFw2_FQGrH57QRLaZ9s73MNumFB8RAo
To claim this, I am signing this object:
@greggigon
greggigon / python.2.7.7.spec
Created Jul 3, 2014
RPM Spec for building Python 2.7.7 on RedHat 6.4
View python.2.7.7.spec
Name: python2.7
Version: 2.7.7
Release: 1%{?dist}
Summary: Python version 2.7.7 installation
Group: Development/Tools
License: GPL
URL: http://python.org
Source0: Python-2.7.7.tgz
@greggigon
greggigon / gist:5949894
Created Jul 8, 2013
Example gradle build file for the Grails NON distribution plugin
View gist:5949894
buildscript {
repositories {
mavenCentral()
maven { url 'http://repo.grails.org/grails/repo/' }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:2.0.0-SNAPSHOT"
}
@greggigon
greggigon / RepositorySize.groovy
Created Jun 19, 2013
This simple Artifactory plugin does a job of Calculating repository size by recursively iterating over Repository items and adding sizes of the artifacts.
View RepositorySize.groovy
import org.artifactory.repo.RepoPathFactory
def getDirectorySizeRecursively(def repoPath){
def children = repositories.getChildren(repoPath)
if (children.size() == 0) return 0
def total = 0
children.each { item ->
if (item.folder) {
total += getDirectorySizeRecursively(item.repoPath)
@greggigon
greggigon / JsonMap.groovy
Last active Sep 27, 2016
I always find myself using a lot of HashMaps in Groovy where in Java I would create a Pojo or something. This little gist turns the map into a somehow formatted JSON. The code assumes that maps are keyed by Strings, can contain other Maps, Lists or Objects. If the map value is an object .toString() will be used to get it's value. Proved useful w…
View JsonMap.groovy
class JsonMap {
def toJSON(elements, depth = 0) {
def json = ""
depth.times { json += "\t" }
json += "{"
elements.each { key, value ->
json += "\"$key\":"
json += jsonValue(value, depth)
json += ", "
}
You can’t perform that action at this time.