On create, update or delete of a training we POST to a single URL (to be delivered by Courseware to Springest) that has to be reachable via HTTPS.
The payload will be JSON, structured as following:
{
"action": "create",
"id": 123456,
{ | |
"id": "123123" | |
} |
<?xml version="1.0" encoding="UTF-8"?> | |
<response> | |
<meta> | |
<results type="integer">1</results> | |
<offset type="integer">0</offset> | |
<filters type="array"/> | |
</meta> | |
<trainings type="array"> | |
<training> | |
<id type="integer">123</id> |
id | Region |
---|---|
1 | Amsterdam |
2 | Rotterdam |
3 | Den Haag |
4 | Utrecht |
5 | Eindhoven |
6 | Groningen |
7 | Tilburg |
8 | Almere / Lelystad |
require 'net/http' | |
# hosts is an Array of hosts to be checked. For example: | |
hosts = ['www.springest.nl', 'www.springest.de', 'www.springest.com'] | |
hosts.each do |host| | |
http = Net::HTTP.new(host, 443) | |
http.use_ssl = true | |
req = Net::HTTP::Head.new('/') |
The SpringSense widget dynamically loads SpringSense content on your page via JavaScript. It also templatable so you can customize the output to fit your own design. This manual will help you set up the widget.
You can load the script by including the following code to the page;
<script src="https://4d9ae17c5ae68590ce6f-1c6f7d77e67457fef78cfb90b7e69696.ssl.cf3.rackcdn.com/assets/springsense.js"></script>
I hereby claim:
To claim this, I am signing this object:
" Set font size based on screen size. When vertical height is greater than 800 | |
" (i.e. an external monitor is attached on a regular 13" MBP), use 18, else use 16. | |
if has('mac') | |
if system("osascript -e 'tell application \"Finder\" to get bounds of window of desktop' | cut -d ',' -f 4 | xargs") > 800 | |
set guifont=Inconsolata\ for\ Powerline:h18 | |
else | |
set guifont=Inconsolata\ for\ Powerline:h16 | |
endif | |
endif |
require 'open-uri' | |
require 'thread' | |
require 'benchmark' | |
# AppServerChecker checks the response for a specific URL on each app server. | |
# It does so by overwriting the Host header to the original hostname to trick | |
# the app server in serving the correct content. It also speeds up the check | |
# by creating a seperate thread for each request and outputs to stdout. | |
# | |
# Usage: |
# Encoding: UTF-8 | |
require 'thread' | |
queue = Queue.new | |
threads = [] | |
20.times do | |
threads << Thread.new do | |
# loop until there are no more things to do |