Skip to content

Instantly share code, notes, and snippets.

View djfpaagman's full-sized avatar

Dennis Paagman djfpaagman

View GitHub Profile
@djfpaagman
djfpaagman / 201.json
Last active August 29, 2015 14:12
Responses for Springest Bookings API
{
"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>
@djfpaagman
djfpaagman / webhooks.md
Last active August 29, 2015 14:06
Springest Webhooks

Webhook feature

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,
@djfpaagman
djfpaagman / meta.md
Created August 25, 2014 10:06
Springest NL meta data possible values
id Region
1 Amsterdam
2 Rotterdam
3 Den Haag
4 Utrecht
5 Eindhoven
6 Groningen
7 Tilburg
8 Almere / Lelystad
@djfpaagman
djfpaagman / ssl_check.rb
Created August 8, 2014 08:58
SSL certificate checker
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('/')
@djfpaagman
djfpaagman / springsense-guide.md
Last active August 29, 2015 14:01
Springsense Widget Setup Guide

Springsense Widget

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.

Loading the SpringSense script

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>

Keybase proof

I hereby claim:

  • I am djfpaagman on github.
  • I am dennispaagman (https://keybase.io/dennispaagman) on keybase.
  • I have a public key whose fingerprint is 91FF 93B4 655D BCF1 1D73 F03F 136A 1E06 9A5E 214F

To claim this, I am signing this object:

@djfpaagman
djfpaagman / gist:7784827
Created December 4, 2013 09:35
Change Vim Font Size Depending on Screen Size
" 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
@djfpaagman
djfpaagman / app_server_checker.rb
Last active December 27, 2015 10:09
Small script to check the http status code of multiple app servers for a certain URL.
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