Skip to content

Instantly share code, notes, and snippets.

View SlyDen's full-sized avatar

Denys Slipetskyy SlyDen

View GitHub Profile
@SlyDen
SlyDen / README.md
Created March 3, 2016 11:38 — forked from StefanWallin/README.md
nginx ssl config with multiple SNI vhosts and A+ SSL Labs score as of 2014-11-05

Configuring nginx for SSL SNI vhosts

Gotchas

Remarks

  • My version of konklones SSL config does not have SPDY support(my nginx+openssl does not support it)
  • You need a default ssl server (example.org-default.conf).
  • Some SSL-options have to be unique across your instance, so it's easier to have them in a common file(ssl.conf).
@SlyDen
SlyDen / 0_reuse_code.js
Created March 10, 2016 11:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@SlyDen
SlyDen / nginx.conf
Created March 11, 2016 15:14 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
class MyConfig {
private final String dogsName
private final int dogsAge
private final List<Raindeer> raindeers
static class Raindeer {
private final String name
private final String position
@JsonCreator
@SlyDen
SlyDen / ee.js
Created March 25, 2016 16:28 — forked from koemeet/ee.js
Inverse relationships issue
// app/models/product.js
export default DS.Model.extend({
masterVariant: DS.belongsTo('product-variant'),
variants: DS.hasMany('product-variant') // only contains the variants that are not master
});
// app/models/product-variant.js
export default DS.Model.extend({
product: DS.belongsTo('product', { inverse: null }),
master: DS.attr('boolean')
package com.jcs.todomvc;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
@SlyDen
SlyDen / Example.java
Created April 8, 2016 08:01 — forked from ldaley/Example.java
Periodic background jobs in Ratpack
import ratpack.exec.ExecController;
import ratpack.exec.Execution;
import ratpack.http.client.HttpClient;
import ratpack.server.RatpackServer;
import ratpack.service.Service;
import ratpack.service.StartEvent;
import ratpack.service.StopEvent;
import java.net.URI;
import java.util.Optional;
@EqualsAndHashCode
class Person {
String name
String surname
int age
}
def test() {
given:
def person = new Person(name: 'name', surname: 'surname', age: 32)
@SlyDen
SlyDen / nexus-service-in-swarm.sh
Created October 26, 2016 06:34
Nexus container in swarm
docker volume create nexus-data
docker service create -p 8081:8081 --name nexus --mount type=volume,src=nexus-data,dst=/nexus-data sonatype/docker-nexus3
docker service update --env-add JAVA_MAX_MEM=768m nexus
model() {
let userPromise = this.store.findAll(‘user’);
userPromise.catch((error) => {
// transition to another route and show some error notification saying your team is doing their best to fix the problem
});
return userPromise;
}