Skip to content

Instantly share code, notes, and snippets.

🕺
an ordinary human being

Vasyl Khrystyuk msangel

🕺
an ordinary human being
Block or report user

Report or block msangel

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
@msangel
msangel / DataAccessor.java
Created Oct 23, 2019
Data PropertyResolverAdapter
View DataAccessor.java
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
msangel / ToLiquid.java
Last active Oct 24, 2019
ToLiquid PropertyResolverAdapter
View ToLiquid.java
package liqp;
/**
* Provide alternative to :to_liquid
* Used in some liquid transformation.
*/
public interface ToLiquid {
Object toLiquid();
}
View Yaml2Props.java
package ua.co.k.yaml2dotnotation;
import org.yaml.snakeyaml.Yaml;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
View traces.shell
03:10:19.728 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
03:10:19.728 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
03:10:19.728 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
03:10:19.728 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Where:
03:10:19.728 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Build file '/home/user/work/javyll/build.gradle' line: 18
03:10:19.728 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
03:10:19.728 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
03:10:19.728 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] A problem occurred evaluating root project 'javyll'.
03:10:19.728 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > lt/neworld/gradle/jdeploy/task/JDeploySetup
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
msangel / ApiModule.java
Last active Jul 27, 2019 — forked from koesie10/ApiModule.java
Retrofit 1 error handling behaviour in Retrofit 2.3.0
View ApiModule.java
// Dagger 1 example
@Module(
complete = false,
library = true
)
public final class ApiModule {
@Provides
@Singleton
Retrofit provideRetrofit(Gson gson, Application app) {
return new Retrofit.Builder()
View fractal.bat
@echo off
set /a xPixels = 180
set /a yPixels = 120
set /a xStart = -22000
set /a yStart = -10000
set /a xSize = 32000
set /a ySize = 20000
set /a maxIter = 32
call ::make_bmp_header
View App.java
package com.polgul.app;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
@msangel
msangel / index.html
Last active Apr 28, 2016
serial promises call till one resolved
View index.html
<html>
<body>
<script>
var variants = ['a', 'b', 'c', '@', 'e'];
var checkMail = function(input){
return new Promise(function(resolve, reject){
if(input.indexOf('@')>-1){
resolve(input);
} else {
reject();
@msangel
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) {
resolve(data);
}).catch(function (err) {
tryes--;
console.log('promise execution fail in:'+ tryes);
if(tryes>0){
if(typeof delay === 'undefined'){
You can’t perform that action at this time.