Skip to content

Instantly share code, notes, and snippets.

View olisikh's full-sized avatar
:shipit:

Oleksii Lisikh olisikh

:shipit:
  • Shell Recharge Solutions
  • Amsterdam, Netherlands
View GitHub Profile
@olisikh
olisikh / nginx.conf
Created October 25, 2012 08:39
Nginx with SSL self-signed certificate + Tomcat
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
@olisikh
olisikh / people_most_communicate.js
Created December 13, 2012 10:20
Mongodb aggregation framework query (pairs of people that tend to communicate a lot)
use enron;
db.messages.aggregate([
{ $unwind: '$headers.To' },
{ $project: { _id: 0, 'headers.To': 1, 'headers.From': 1 } },
{ $group: { _id: { to: '$headers.To', from: '$headers.From' }, count: { $sum : 1 } } },
{ $sort: { count: -1 } },
{ $limit: 5 }
]);
@olisikh
olisikh / MultipartFileSender
Created December 24, 2016 16:58 — forked from davinkevin/MultipartFileSender
Implementing HTTP byte-range requests in Spring 4 and other framework...
package lan.dk.podcastserver.utils.multipart;
import lan.dk.podcastserver.utils.MimeTypeUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class RomanToInt {
private static final Map<String, Integer> conversionMap = new HashMap<String, Integer>() {
{
put("I", 1);
put("IV", 4);
put("V", 5);
put("IX", 9);
put("X", 10);
put("XL", 40);
put("L", 50);