Skip to content

Instantly share code, notes, and snippets.

View gdanko's full-sized avatar
💭
I love Ashleigh!

Gary Danko gdanko

💭
I love Ashleigh!
View GitHub Profile
#!/usr/bin/ruby
require "hipchat"
require "pp"
hc = HipChat.new({
"token" => "MYTOKEN"
})
hc.debug("on")
# Inside the chef template erb file we can do this:
<%= "[mindadmin]" %>
<% node[:splunk][:roles][:miniadmin].each do |key, value| %>
<%= "#{key} = #{value}" %>
<% end %>
function status_fn_oor_state(jobId) {
var status_fn_oor_state_cfg = {
method: 'GET',
on: {
success: function(id, o) {
var jsonString = o.responseText;
rec = Y.JSON.parse(jsonString);
rec.data = rec.result.output;
rec.result.output = undefined;
if(rec.result.status !== 'completed' && rec.result.status !== 'completed_with_map_errors'
@gdanko
gdanko / hash2xml.rb
Last active April 3, 2018 21:18
A simple hash > XML converter using REXML
class ::Hash
require "rexml/document"
def to_xml(indent: nil, rootname: nil, output: nil, encoding: nil)
indent = indent ? indent : 2
rootname = rootname ? rootname : "root"
output = output == $stdout ? $stdout : nil
encoding = encoding ? encoding : "UTF-8"
xml = REXML::Document.new
formatter = REXML::Formatters::Pretty.new(indent)
formatter.compact = true
package main
import (
"archive/tar"
"bytes"
"context"
"encoding/json"
"fmt"
"github.com/docker/docker/api/types"
"github.com/docker/docker/client"