Last active

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Groovy program that rewrites itself exactly using a new, random filename.

View replicator.groovy
1 2 3 4 5
def p = '''
@Grab(group='commons-lang', module='commons-lang', version='2.4') import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric
File file = new File("${randomAlphanumeric(8)}.groovy").write(p)
new GroovyShell(new Binding([p: "def p = ${"'"*3}${p}${"'"*3}; ${p.readLines()[3]}"])).evaluate(p.readLines()[0..2].join(';') as String)
'''; new GroovyShell(new Binding([p: "def p = ${"'"*3}${p}${"'"*3}; ${p.readLines()[3]}"])).evaluate(p.readLines()[0..2].join(';') as String)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.