This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override def toString = new ToStringBuilder(this) | |
.toString | |
override def equals(obj: Any) = obj match { | |
case other: $CLASSNAME$ => other.getClass == getClass && | |
new EqualsBuilder() | |
.isEquals | |
case _ => false | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; http://aperiodic.net/phil/scala/s-99/ | |
; P01 - find the last element of a list | |
(defn p01 [the-list] | |
(if (empty? (rest the-list)) | |
(first the-list) | |
(recur (rest the-list)) | |
) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
if ARGV.length == 0 | |
puts "Usage: #{__FILE__} <name of FXG to de-fubar>" | |
exit 1 | |
end | |
filename = ARGV[0] | |
out = File.open("#{filename}.fixed", 'w') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
def get_teamcity_status(server_host) | |
doc = Nokogiri::HTML(open("http://#{server_host}/externalStatus.html")) | |
build_count = doc.css('table.tcTable').size | |
failure_count = 0 | |
fatal_count = doc.css('span.teamCityErrorMessage').size |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
def get_nagios_status(server_host, username = 'monitor', password = 'monitor') | |
doc = Nokogiri::HTML(open("http://#{server_host}/nagios/cgi-bin/status.cgi?servicestatustypes=28&hoststatustypes=15", :http_basic_authentication => [username, password])) | |
hosts = [] | |
last_title = nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public boolean equals(final Object obj) { | |
if (obj == null) { | |
return false; | |
} | |
if (obj == this) { | |
return true; | |
} | |
if (obj.getClass() != getClass()) { | |
return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.rabbitmq.client.Channel; | |
import com.rabbitmq.client.Connection; | |
import com.rabbitmq.client.ConnectionFactory; | |
import java.io.IOException; | |
public class Unbinder { | |
public static void main(final String[] args) { | |
final ConnectionFactory factory = new ConnectionFactory(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -r 54ce482842cf src/rabbit_ws_sockjs.erl | |
--- a/src/rabbit_ws_sockjs.erl Tue Nov 20 13:40:31 2012 +0000 | |
+++ b/src/rabbit_ws_sockjs.erl Thu Jan 17 12:48:54 2013 +0000 | |
@@ -26,7 +26,13 @@ | |
-spec init() -> ok. | |
init() -> | |
Port = get_env(port, 55674), | |
+ HttpsPort = get_env(http_port, 55675), | |
SockjsOpts = get_env(sockjs_opts, []) ++ [{logger, fun logger/3}], | |
+ HttpsEnabled = get_env(ssl_enabled, false), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# These are very quick & dirty notes on getting Icinga installed on Centos 6.5 via RPMs, | |
# as most documentation seems to be based around source installation. It's mostly recovered from | |
# my history as I worked it out, so no guarantees are offered. | |
# Make EPEL available | |
sudo rpm -Uvh http://mirror.bytemark.co.uk/fedora/epel/6/i386/epel-release-6-8.noarch.rpm | |
# Install HTTPd | |
sudo yum install httpd | |
sudo service https start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rexml/document' | |
require 'rexml/element' | |
doc = REXML::Document.new(File.open('London_Classic_2015.gpx', 'r')) | |
second = 0 | |
min = 0 | |
hour = 1 |
OlderNewer