Skip to content

Instantly share code, notes, and snippets.

Avatar

Zilvinas Vilutis cikasfm

View GitHub Profile
View AngularedCollectionController.js
sciApp.controller('AngularedCollectionController', ['$scope', '$compile', function ($scope, $compile) {
$scope.index = 1;
$scope.init = function (collectionId) {
var indexes = [];
$('#' + collectionId).find('input[type=hidden]').each(function () {
var attrName = $(this).attr('name');
var indexFinder = new RegExp('\\]\\[(\\d+)\\]\\[');
@cikasfm
cikasfm / MvelTest.java
Created Jul 11, 2014
Verifies MVEL "contains" operator behavior
View MvelTest.java
import static org.junit.Assert.*;
import java.util.*;
import org.junit.Test;
import org.mvel2.MVEL;
/**
* @author Zilvinas Vilutis
View MoonPhaseCalc.java
/**
* Moon Phase Calculator
*
* @author Zilvinas Vilutis
*/
public class MoonPhaseCalc {
public final static String format = "yyyy-MM-dd";
private static final int moonPhaseHours = 709;
View RemovingMinimalNumberOfLetters.java
/**
* The problem:
*
* http://stackoverflow.com/questions/15314616/removing-minimal-letters-from-a-
* string-a-to-remove-all-instances-of-string-b
*
* <p>
* If we have string A of length N and string B of length M, where M < N, can I
* quickly compute the minimum number of letters I have to remove from string A
* so that string B does not occur as a substring in A?<br/>