Skip to content

Instantly share code, notes, and snippets.

View igormukhin's full-sized avatar

Igor Mukhin igormukhin

View GitHub Profile
package de.wirthedv.tools.developer.interview;
import static org.junit.Assert.assertEquals;
import java.util.Calendar;
import org.junit.Test;
public class TestYearMonth {
@igormukhin
igormukhin / LongRunning.java
Created October 2, 2016 22:51
Template for demonstrating DCEVM
package sample.dcevm;
import java.util.Date;
public class LongRunning {
private final Worker worker;
public static void main(String[] args) {
@igormukhin
igormukhin / set.js
Created September 20, 2016 15:48
Mimics Java Set in JavaScript (DRAFT, NOT TESTED)
function Set() {
this.data = {};
this.add.apply(this, arguments);
}
Set.prototype = {
add: function (key) {
this.data[key] = true;
},
@igormukhin
igormukhin / executionChain.html
Created September 19, 2016 13:18
Example of an ordered processing of asynchronous event handled by asynchronous handlers (JavaScript / jQuery, Promise).
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
</head>
<script>
/**
import java.math.*;
import java.util.concurrent.atomic.*;
public class Solution {
public String largestNumber(int[] nums) {
if (nums == null || nums.length == 0) {
return "0";
}
List<Integer> sortedNums = new ArrayList<Integer>(nums.length);
@igormukhin
igormukhin / FindCssFilesWithoutLess.java
Created June 29, 2016 14:09
Searches in a directory recursively for CSS files that has no corresponding LESS files
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
public class FindCssFilesWithoutLess {
public static void main(String[] args) throws IOException {
Path filesSrcDir = Paths.get(".\\data");
Files.walk(filesSrcDir)
import java.nio.file.Files
import java.nio.file.Path
import java.nio.file.Paths
import java.util.regex.Pattern
fun main(args: Array<String>) {
val filesSrcDir = Paths.get(args[0])
val renames: MutableMap<Path, String> = hashMapOf()
@igormukhin
igormukhin / extract-links-from-boxopus.js
Created October 14, 2015 19:28
Extracts a list of download URLs from the Boxopus files download page
@igormukhin
igormukhin / convertDotSubJsToSrt.html
Created June 11, 2015 18:41
Converts dotsub json subtitles to srt format
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
<script>
$(function () {
var arr = [
{startTime: 3040, duration: 7023, content: "Probing the Future - with Jacque Fresco - Venus Project director", isStartOfParagraph: false},
@igormukhin
igormukhin / comparedirs.groovy
Last active May 9, 2016 12:59
Groovy script to compare two directory trees and output the differences
import groovy.transform.Field
@Field int processed = 0;
def dir1 = new File(args[0])
def dir2 = new File(args[1])
def diff = compareDirs(dir1, dir2)
diff.each {
printFileInfo(it.left, dir1, "Left: ")