Skip to content

Instantly share code, notes, and snippets.

Dmitrii Volykhin volyx

Block or report user

Report or block volyx

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@volyx
volyx / templateReplace.java
Last active Jan 16, 2018
Fully extendable java html template engine
View templateReplace.java
// regex for uri template pattern
public static Pattern TEMPLATE_PATTERN = Pattern.compile("\\{(.*?)\\}");
public static String templateReplace(String template,
Map<String, Object> properties) {
String result = template;
try {
if (template != null && template.contains("{")
&& template.contains("}")) {
Matcher m = TEMPLATE_PATTERN.matcher(template);
View Ratpack.groovy
@Grapes([
@Grab('io.ratpack:ratpack-groovy:1.5.0-rc-2'),
@Grab('org.slf4j:slf4j-simple:1.7.25')
])
import static ratpack.groovy.Groovy.ratpack
import ratpack.jackson.*;
class User {
String name;
String surname;
View Main2.java
import javafx.util.Pair;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.*;
import java.util.function.ToIntFunction;
public class Main2 {
public static void main(String[] args) throws FileNotFoundException {
View Main2.java
import javafx.util.Pair;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.*;
import java.util.function.ToIntFunction;
public class Main2 {
public static void main(String[] args) throws FileNotFoundException {
View Main2.java
import javafx.util.Pair;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.*;
import java.util.function.ToIntFunction;
public class Main2 {
public static void main(String[] args) throws FileNotFoundException {
@volyx
volyx / Main.java
Created Mar 5, 2017
VK cup 2017 A
View Main.java
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws FileNotFoundException {
View WebSocketClient.java
package net.swarmdb;
import io.netty.bootstrap.Bootstrap;
import io.netty.buffer.Unpooled;
import io.netty.channel.Channel;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.SocketChannel;
View main.cpp
#include <iostream>
using namespace std;
void read()
{
int c;
std::cin >> c;
View feed-photo-grid.js
define([
'backbone',
], function(Backbone) {
var feedPhotoGrid = Backbone.View.extend({
options: {
rowSelector: '.feed-photo-row',
cellSelector: '.feed-photo-cell',
View Main.java
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Arrays;
import java.util.Scanner;
/*
5
2 3 9 2 9
10
You can’t perform that action at this time.