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
# Mac rxvt-unicode setup. | |
# http://rcrowley.org/articles/rxvt-unicode.html | |
# Install dependencies from MacPorts and CPAN. | |
sudo port install rxvt-unicode +xterm_colors_256 | |
sudo port install terminus-font | |
sudo cpan install Mac::Pasteboard | |
# Run urxvt at X11 startup. | |
defaults write org.x.X11 app_to_run /opt/local/bin/urxvt |
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
Request NO GZIP: | |
curl http://localhost:8080/customers/1111 --silent --write-out "%{size_download}\n" --output /dev/null | |
Request GZIP: | |
curl http://localhost:8080/customers/1111 --silent -H "Accept-Encoding: gzip,deflate" --write-out "%{size_download}\n" --output /dev/null |
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
ab -n 1000 -c 10 http://www.google.com/ |
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
@FunctionalInterface | |
public interface ObjectEntitySetter extends Consumer<ObjectEntity> {} | |
public static ObjectEntity build(ObjectEntitySetter... ObjectEntitySetters) { | |
final ObjectEntity object = new ObjectEntity(); | |
Stream.of(ObjectEntitySetters).forEach( | |
s -> s.accept(object) | |
); | |
return object; |
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
Docker in MAC | |
https://docs.docker.com/installation/mac/ | |
Create an image | |
sudo docker build -t eif_accounts . | |
Run image |
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
git fetch upstream | |
git merge upstream/master | |
Reference: | |
https://help.github.com/articles/syncing-a-fork/ |
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
package com.paddypower.financials.market.management.rest.logging; | |
import java.io.BufferedReader; | |
import java.io.ByteArrayInputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import javax.servlet.Filter; | |
import javax.servlet.FilterChain; |
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
# define some variables | |
variable "aws_ubuntu_ami" { | |
default = "ami-972444ad" | |
} | |
variable "aws_keypair" { | |
default = "xxxx" | |
} | |
# AWS account details |
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
Extract public key from pem private key | |
ssh-keygen -y -f KEYFILE.pem |
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
public String getCarInsuranceName(Optional<Person> person) { | |
return person.flatMap(Person::getCar) | |
.flatMap(Car::getInsurance) | |
.map(Insurance::getName) | |
.orElse("Unknown"); | |
} |
OlderNewer