Skip to content

Instantly share code, notes, and snippets.

View akaguny's full-sized avatar
🏠
Working from home

Alexey akaguny

🏠
Working from home
View GitHub Profile
@akaguny
akaguny / README.md
Last active February 16, 2023 06:01

Hi 👋, I'm Alexey Shcherbakov

Teamlead, FE developer

Connect with me:

shcherbakov

Languages and Tools:

@akaguny
akaguny / creatium-sdk.html
Created December 17, 2022 21:22
creatium custom js sdk
<script type="text/javascript">
// @ts-check
(function registerCreatiumSDK(libNamespace, libVersion) {
/**
* fire custom event, when the localsorage interractions. Src from: https://stackoverflow.com/a/69380917
* @param {String} eventName - name of the event
*/
function fireEventWhenLocalstorageChanged(eventName) {
Storage.prototype.setItem = new Proxy(Storage.prototype.setItem, {
apply(target, thisArg, [key, newValue]) {
@akaguny
akaguny / my-custom-reporter.js
Last active April 13, 2019 05:15
custom reporter without types jset ^24
// my-custom-reporter.js
class MyCustomReporter {
constructor(globalConfig, options) {
this._globalConfig = globalConfig;
this._options = options;
}
onRunComplete(contexts, results) {
console.log('onRunComplete => Custom reporter output:');
console.log('onRunComplete => GlobalConfig: ', this._globalConfig);
@akaguny
akaguny / GitHub-Forking.md
Created March 3, 2018 06:30 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@akaguny
akaguny / launch.json
Last active November 27, 2017 05:14
Visual Studio code (VSC) launch.json Gruntjs
[{
"type": "node",
"request": "launch",
"name": "bfe teamcity",
"runtimeExecutable": "grunt",
"cwd": "${workspaceFolder}/devTools/js",
"args": [
"build-failer-eslint"
],
"env": {
@akaguny
akaguny / pre-commit.sh
Created September 28, 2017 13:20 — forked from mykyta-shulipa/pre-commit.sh
Pre-commit hook for eslint, linting *only* staged changes without deleted files
#!/bin/bash
for file in $(git diff --diff-filter=d --cached --name-only | grep -E '\.(js|jsx)$')
do
git show ":$file" | node_modules/.bin/eslint --stdin --stdin-filename "$file" # we only want to lint the staged changes, not any un-staged changes
if [ $? -ne 0 ]; then
echo "ESLint failed on staged file '$file'. Please check your code and try again."
exit 1 # exit with failure status
fi
done
let stdout = '';
beforeEach(() => {
stdout = '';
process.stdout.write = (function (write) {
return function (string, encoding, fileDescriptor) {
stdout += `${string}\n`;
write.apply(process.stdout, arguments);
};
})(process.stdout.write);
@akaguny
akaguny / index.html
Created February 8, 2017 06:24 — forked from anonymous/index.html
JS Bin // source http://jsbin.com/kiziri
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
<style id="jsbin-css">
.ng-modal-overlay {
/* A dark translucent div that covers the whole screen */
position:absolute;
@akaguny
akaguny / app.js
Created July 7, 2016 16:07
Simple fast start with Mocha and Chai browser | Быстрый старт motha и chai в браузере
"use strict";
var Checkbox = function(elementId,target,action){
if(arguments.length < 2 && (elementId === undefined || target === undefined)){
throw new Error();
}
};
@akaguny
akaguny / mocha-guide-to-testing.js
Created July 6, 2016 10:50 — forked from samwize/mocha-guide-to-testing.js
Explain Mocha's testing framework - describe(), it() and before()/etc hooks
// # Mocha Guide to Testing
// Objective is to explain describe(), it(), and before()/etc hooks
// 1. `describe()` is merely for grouping, which you can nest as deep
// 2. `it()` is a test case
// 3. `before()`, `beforeEach()`, `after()`, `afterEach()` are hooks to run
// before/after first/each it() or describe().
//
// Which means, `before()` is run before first it()/describe()