Skip to content

Instantly share code, notes, and snippets.

@LukasMac
LukasMac / riksbankFx.js
Last active February 20, 2024 12:30
riksbank USD and EUR exchange rate
// In Google sheets make sure the date is passed as text.
// If you have date use formula: =Text(A31, "yyyy-mm-dd")
const exchangeRates = [
['2014-01-01', 'EUR', 0],
['2014-01-02', 'EUR', 8.8855],
['2014-01-03', 'EUR', 8.8825],
['2014-01-04', 'EUR', 0],
['2014-01-05', 'EUR', 0],
['2014-01-06', 'EUR', 0],
@LukasMac
LukasMac / nginx.conf
Last active June 22, 2019 17:35
nginx.conf playground
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
@LukasMac
LukasMac / unhealthy_fnord_test
Created November 4, 2014 16:13
Varnish test: unhealthy backend responds with cached content
varnishtest "Unhealthy Fnord responds with cached content"
# fnord. fake server name must start with "s"
server s1 {
rxreq
expect req.url == "/platform/test"
txresp -hdr "Content-Type: application/vnd.itv.ctv.production.v1+hal+json; charset=UTF-8" -hdr "Vary: Accept" -body "{\"hello\": \"world\"}"
accept
@LukasMac
LukasMac / expired_grace_period_varnish_test.vct
Created October 23, 2014 16:56
Sample varnish test for testing items with expired grace period
varnishtest "Check expired grace with sick backends"
# ################################
# Sample varnishtest script to test expired varnish grace period.
# TODO:
# - Include our VCL
# - Overwrite grace and ttl periods
# ################################
server s1 {