Skip to content

Instantly share code, notes, and snippets.

Andrew Zakordonets azakordonets

Block or report user

Report or block azakordonets

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
@azakordonets
azakordonets / ghostImageAlignment.html
Created Apr 15, 2014
Some code for image alignment in ghost blog editor
View ghostImageAlignment.html
<!--To center an image-->
<p align="center">
![alt]()
</p>
<!--To right align an image-->
<p align="right">
![alt]()
</p>
View iban.json
{
"values": [
{
"country": "Albania",
"length": "28",
"code": "AL",
"format": "AL2!n8!n16!c"
},
{
"country": "Andorra",
@azakordonets
azakordonets / simpleHttpServer.py
Created Sep 1, 2013
Python simple HTTP Server that get's two variables for launch - port and time delay( time after which server will return response) . If we do not specify this two values, then server starts on 8000 port with delay = 0
View simpleHttpServer.py
#!/usr/bin/env python
import SimpleHTTPServer, BaseHTTPServer, SocketServer, socket, time, sys
class ThreadedHTTPServer(SocketServer.ThreadingMixIn,
BaseHTTPServer.HTTPServer) :
"""
New features w/r to BaseHTTPServer.HTTPServer:
- serves multiple requests simultaneously
- catches socket.timeout and socket.error exceptions (raised from
@azakordonets
azakordonets / subsctring_in_pipe.sh
Created Aug 20, 2019
Substring string in the piped command from command line
View subsctring_in_pipe.sh
echo "1234567890" | cut -b 1-6
@azakordonets
azakordonets / subsctring_in_pipe.sh
Created Aug 20, 2019
Substring string in the piped command from command line
View subsctring_in_pipe.sh
echo "1234567890" | cut -b 1-6
@azakordonets
azakordonets / dummyXCUITest.swift
Created Apr 25, 2018
This is an example of how to use XCTContext.runActivity method in page object patter for XCUITest. This allows to get nice reports with Allure in the future.
View dummyXCUITest.swift
class LoginPage {
func login(with userName: String, and password: String): SomeOtherPage {
return XCTContext.runActivity("Login as existing user") {
this.enter(userName: userName)
this.enter(password: password)
this.submit()
return new SomeOtherPage(app: this.app);
}
}
@azakordonets
azakordonets / Dockerfile
Created Jul 23, 2019
Standalone Pact running in alpine Docker image
View Dockerfile
FROM alpine:3.9
RUN apk --no-cache add ca-certificates wget bash \
&& wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \
&& wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.29-r0/glibc-2.29-r0.apk \
&& apk add glibc-2.29-r0.apk
RUN wget https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v1.69.0/pact-1.69.0-linux-x86_64.tar.gz \
&& tar xzf pact-1.69.0-linux-x86_64.tar.gz \
&& rm -rf pact-1.69.0-linux-x86_64.tar.gz
@azakordonets
azakordonets / encryptPassWordWithCryptoJs.js
Last active Jul 23, 2019
This gist describes how to encode password with salt using SHA256 algorithm. It shows how to do it with google crypto-js library and Node.js module crypto
View encryptPassWordWithCryptoJs.js
var CryptoJS = require('crypto-js');
var algo = CryptoJS.algo.SHA256.create();
algo.update(password, 'utf-8');
algo.update(CryptoJS.SHA256(salt), 'utf-8');
var hash = algo.finalize().toString(CryptoJS.enc.Base64);
console.log(hash);
@azakordonets
azakordonets / ResultSetConvertor.java
Last active Nov 25, 2018
This class is designed to convert ResultSet data taken as a result of Db query into JSON. Also additional coverter methods are available
View ResultSetConvertor.java
import org.json.JSONArray;
import org.json.JSONObject;
import java.sql.ResultSet;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.Locale;
/**
* Utility for converting ResultSets into some Output formats
View run_es6_code_in_sublime.js
{
"cmd": ["babel-node", "$file"],
"selector": "source.js",
"path": "/usr/local/bin:$PATH", // ENV setting for mac users
"quiet": true // get rid of annoying `[Finished in %fs]`
}
You can’t perform that action at this time.