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
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 Feb 25, 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'){
@msangel
msangel / miniajax
Last active Mar 16, 2019
Mini Ajax is a Lightweight Javascript AJAX library
View miniajax
HOW TO USE:
ajax.x - The XMLHttpRequest object (or MS equivalent) used for communication
ajax.serialize(f)
f = the form element you wish to be serialized
This function serializes all the fields in a form so that they can be passed as a query string in the form 'arg1=val1&arg2=val2'.
ajax.get(url, func)
url = the url to query (can contain arguments after a '?')
@msangel
msangel / ProviderSignInController.java
Last active Dec 18, 2015
ProviderSignInController implementation without redirect for selecting username by user(and fall to userid from linkedin springsocial as spring security user id) more tags: org.socialsignin.springsocial.security.api.SpringSocialProfile SpringSocialProfile org.socialsignin.springsocial.security.signin.SpringSocialSecuritySignInService SpringSocia…
View ProviderSignInController.java
package net.sinistersky.j2ee.support;
import java.util.List;
import javax.inject.Inject;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.socialsignin.springsocial.security.api.SpringSocialProfile;
You can’t perform that action at this time.