Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
verbose = ARGV[0] == '-v'
def colorize(text, color_code)
"\e[#{color_code}m#{text}\e[0m"
end
def red(text); colorize(text, 31); end
def green(text); colorize(text, 32); end
@op-ct
op-ct / install-gradle-centos.sh
Last active February 17, 2016 23:23 — forked from parzonka/install-gradle-centos.sh
Install gradle on redhat/centos linux
# Originally from:
# https://gist.github.com/parzonka/9371885
# ------------------------------------------------------------------------------
# - required packages: unzip, java
# - installs to /opt/gradle
# - existing versions are not overwritten/deleted
# - seamless upgrades/downgrades
# - $GRADLE_HOME points to latest *installed* (not released)
# ------------------------------------------------------------------------------
@op-ct
op-ct / 0_reuse_code.js
Created October 21, 2015 00:56
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@op-ct
op-ct / catalog_dump_from_spec_test.rb
Last active January 13, 2016 10:04 — forked from spiette/gist:5280394
Dumping the catalog from within a Puppet spec test
# WARNING: massive screen scroll
$stdout.puts self.catalogue.to_yaml
# Save to file
File.open( '_catalog.yaml', 'w'){ |f| f.puts self.catalogue.to_yaml }