Skip to content

Instantly share code, notes, and snippets.

Avatar

Mathias Bogaert analytically

View GitHub Profile
@analytically
analytically / rating.md
Created Jun 19, 2018 — forked from alexflav23/rating.md
Interview rating
View rating.md

Interview score card

Part 1. Basic knowledge

  1. (2 points) Easy: What is the difference beteen var, val and def? [x] 2
  2. (3 points) Easy: How does pattern matching work in Scala? [x] 3
  3. (3 points) Easy: What are right associative methods in Scala? [x] 0
  4. (3 points) Easy: What is the difference between a trait and an abstract class in Scala? [x] 3
  5. (2 points) Medium: What is scala.util.control.NonFatal? [x] 2
  6. (3 points) Medium: How does Scala solve the diamond resolution problem with traits? [x] 3
View keybase.md

Keybase proof

I hereby claim:

  • I am analytically on github.
  • I am analytically (https://keybase.io/analytically) on keybase.
  • I have a public key whose fingerprint is 6560 B522 27E1 4A62 A9A0 4685 FB67 7394 51EC 486A

To claim this, I am signing this object:

@analytically
analytically / README.md
Created Sep 1, 2016 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications
View README.md


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


Index:

@analytically
analytically / gist:1a6bdcfa711474d7ba24
Last active Aug 19, 2017
Ubuntu 14.04 AWS EC2 cloud-init (Kernel 3.18+NTP+ixgbevf+Docker+Route53) - to be used with ami-870a2fb7 and newer instance types (eg. t2, m3, c3, r3)
View gist:1a6bdcfa711474d7ba24
#!/bin/bash
set -e
sudo rm -f /etc/update-motd.d/10-help-text
sudo rm -f /etc/update-motd.d/51-cloudguest
sudo rm -f /etc/update-motd.d/91-release-upgrade
echo -e "[sysinfo]\nexclude_sysinfo_plugins = LandscapeLink" | sudo tee /etc/landscape/client.conf
echo deb https://get.docker.com/ubuntu docker main | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
@analytically
analytically / interfaces
Last active Nov 15, 2018
Ansible interface bonding tasks.
View interfaces
# {{ ansible_managed }}
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
{% if ansible_interfaces|length > 2 %}
@analytically
analytically / gist:5760207
Created Jun 11, 2013
Ansible /etc/network/interfaces template
View gist:5760207
# {{ ansible_managed }}
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
{% if ansible_interfaces|length > 2 %}
@analytically
analytically / gist:4295042
Created Dec 15, 2012
Migration of gist:4293859
View gist:4295042
def rateLimit(action: => String, subject: => String, maxRequests: => Int): Directive0 = {
mapInnerRoute {
inner => ctx =>
val key = action + ":" + subject
add(redis, key)
val actionCount = count(redis, key, interval)
if (actionCount >= maxRequests) {
logger.warn("Rate limiting user '" + subject + "': exceeded max number of requests (" + maxRequests + ").")
@analytically
analytically / gist:4293859
Created Dec 15, 2012
Rate limiting code using Spray 1.0-M2, needs migration.
View gist:4293859
def rateLimit(action: String, subject: String, maxRequests: Int) = {
val key = action + ":" + subject
add(redis, key)
val actionCount = count(redis, key, interval)
transformRequestContext {
ctx =>
ctx.withResponseTransformed {
response =>
@analytically
analytically / gist:3077691
Created Jul 9, 2012
Spray XStream marshalling support
View gist:3077691
import cc.spray.typeconversion.{DefaultMarshallers, SimpleMarshaller, SimpleUnmarshaller, DefaultUnmarshallers}
import com.thoughtworks.xstream.XStream
import com.thoughtworks.xstream.io.xml.StaxDriver
import cc.spray.http._
import MediaTypes._
import HttpCharsets._
import cc.spray.json._
import cc.spray.SprayBaseSettings
import cc.spray.http.ContentTypeRange