Skip to content

Instantly share code, notes, and snippets.

View nkbt's full-sized avatar
💚

Nikita Butenko nkbt

💚
View GitHub Profile
@nkbt
nkbt / loader.js
Last active December 7, 2023 12:19
Old fashioned loader
var loading = "\\|/—",
tick = 0,
loadingElement = document.createElement('div');
loadingElement.id = 'loading';
loadingElement.style.fontFamily = 'Consolas, "Liberation Mono", Courier, monospace';
document.body.innerHTML = '';
document.body.appendChild(loadingElement);
(function animate() {
tick = (tick + 1) % loading.length;
@nkbt
nkbt / .jshintrc
Last active May 20, 2021 07:02
.jshintrc - NodeJS
{
// -----------------
// --------------------------------------------------------------------
// JSHint Configuration, Strict Edition
// --------------------------------------------------------------------
//
// This is a options template for [JSHint][1], using [JSHint example][2]
// and [Ory Band's example][3] as basis and setting config values to
// be most strict:
//
@nkbt
nkbt / .jshintrc
Last active January 10, 2023 04:04
.jshintrc - Browser
{
// -----------------
// --------------------------------------------------------------------
// JSHint Configuration, Strict Edition
// --------------------------------------------------------------------
//
// This is a options template for [JSHint][1], using [JSHint example][2]
// and [Ory Band's example][3] as basis and setting config values to
// be most strict:
//
'use strict';
/**
* @typedef {Entity} DomainEntity
*
* @property {function(): String} getId
* @property {function(): String} getName
* @property {function(): Number} getPrice
* @property {function(): Number} getQuantity
*
@nkbt
nkbt / PeopleBrowsr.xml
Created December 17, 2013 00:11
PeopleBrowsr PHP/Webstorm auto-formatter config put to: <user>/.WebIde70/config/codestyles/PeopleBrowsr.xml
<?xml version="1.0" encoding="UTF-8"?>
<code_scheme name="PeopleBrowsr">
<option name="OTHER_INDENT_OPTIONS">
<value>
<option name="INDENT_SIZE" value="4" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="true" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
@nkbt
nkbt / Quall Dracula.icls
Created December 17, 2013 00:14
Less aggressive Dracula color theme for PHP/Webstorm
<?xml version="1.0" encoding="UTF-8"?>
<scheme name="Quall Dracula" version="124" parent_scheme="Default">
<option name="LINE_SPACING" value="1.1" />
<option name="EDITOR_FONT_SIZE" value="14" />
<option name="CONSOLE_FONT_NAME" value="Consolas" />
<option name="CONSOLE_FONT_SIZE" value="16" />
<option name="CONSOLE_LINE_SPACING" value="0.9" />
<option name="EDITOR_FONT_NAME" value="Consolas" />
<colors>
<option name="ADDED_LINES_COLOR" value="d6822" />
@nkbt
nkbt / app.js
Created December 23, 2013 11:54
require.config({
urlArgs: window.noCacheSuffix,
baseUrl: 'js',
paths: {
underscore: 'vendor/underscore',
dom: 'vendor/jquery',
bootstrap: '../lib/bootstrap/js/bootstrap',
Firebase: 'https://cdn.firebase.com/v0/firebase',
FirebaseSimpleLogin: 'https://cdn.firebase.com/v0/firebase-simple-login'
},
@nkbt
nkbt / chat.js
Created December 23, 2013 11:57
define('app/chat', [
'dom', 'underscore', 'lib/app'
], function ($, _, app) {
"use strict";
function init() {
var $element = $('.jsAppChat').html(app.template('template/app/chat'));
$element.find('.jsAppChat-formContainer')
.html(app.template('template/app/chat/form'));
}
it('should return error if at least one domain is unavailable', function (done) {
nock(test.mock.user)
.intercept('/info', 'SEARCH', {"count": 100, "query": "data.name:\"test.test\" AND type:\"domain\" AND name:\"reseller.pb\""})
.replyWithFile(200, __dirname + '/fixtures/info/found.json');
nock(test.mock.admin)
.get('/user/aaaa11112222333344445555', {})
.replyWithFile(200, __dirname + '/fixtures/user/_nkbt.json');
@nkbt
nkbt / async-auto.js
Created February 27, 2014 00:07
async.auto
var _ = require('underscore');
var async = require('async');
async.auto({
first: function(next) {
setTimeout(next, 500);
},
second: function(next) {
setTimeout(next, 700);
},