Skip to content

Instantly share code, notes, and snippets.

an ordinary human being

Vasyl Khrystyuk msangel

an ordinary human being
View GitHub Profile
msangel /
Created Oct 23, 2019
Data PropertyResolverAdapter
package liqp;
import java.util.Map;
* Provide alternative to :data
* Used in some liquid transformation also used as main data storage in data model of jekyll.
public interface DataAccessor {
Map<String, Object> getData();
msangel /
Last active Oct 24, 2019
ToLiquid PropertyResolverAdapter
package liqp;
* Provide alternative to :to_liquid
* Used in some liquid transformation.
public interface ToLiquid {
Object toLiquid();
import org.yaml.snakeyaml.Yaml;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
View gist:e171ba1ee6c3a9b2ac3328fc8d356bf4

Theory and history.

Regular expressions (regexp) is a formal language for searching and manipulating with substrings in text. Regular expressions is based on usage if meta-symbols (wildcard characters). This is, actually, a string pattern, which formalizing a search rule (wiki) .

There exists two kinds of regular expressions:

  • POSIX (older one, basics)
  • PCRE (perl-compatible regular expressions, more extended)
msangel /
Last active Jul 27, 2019 — forked from koesie10/
Retrofit 1 error handling behaviour in Retrofit 2.3.0
// Dagger 1 example
complete = false,
library = true
public final class ApiModule {
Retrofit provideRetrofit(Gson gson, Application app) {
return new Retrofit.Builder()
msangel / tryable promise.js
Last active Feb 25, 2016
this is function for creating tryable promise. as far as promise is not reusable, this accept promise factory, that create new promise for each try
View tryable promise.js
var createTryablePromise = function (promiseFactory, tryes, delay) {
return new Promise(function (resolve, reject) {
var processOnce = function () {
promiseFactory().then(function (data) {
}).catch(function (err) {
console.log('promise execution fail in:'+ tryes);
if(typeof delay === 'undefined'){