Skip to content

Instantly share code, notes, and snippets.

View just-boris's full-sized avatar
💭
I may be slow to respond.

Boris Serdiuk just-boris

💭
I may be slow to respond.
View GitHub Profile
@just-boris
just-boris / playbook.yml
Created July 9, 2015 11:57
Multieval deploy recipe
- hosts: multieval
remote_user: just-boris
tasks:
- name: Install packages
sudo: true
apt: name={{item}}
with_items:
- jetty
- nginx
- name: Creates directory
@just-boris
just-boris / unit-test.js
Created October 19, 2015 14:52
JSUnderhood
describe('tests', function() {
function createElement(html, options) {
var wrapper = $('<div></div>');
$(html || "<select></select>").appendTo(wrapper).selectize(options || {});
return wrapper;
}
beforeEach(function () {
var $element = createElement('<select>' +
'<option value="1">Foo</option>' +
@just-boris
just-boris / test.js
Created October 20, 2015 09:45
JSUnderhood webdriver.io
"use strict";
var webdriverio = require("webdriverio");
var config = require("../config");
describe("webdriverio spec", function() {
beforeEach(function() {
this.webdriver = webdriverio.remote({
desiredCapabilities: config.capabilities,
host: config.seleniumHost
});
@just-boris
just-boris / search-page.js
Last active October 20, 2015 13:03
JSUnderhood webdirver.io PageObject
"use strict";
function SearchBox(selector) {
this.selector = selector || ".search2";
this.input = this.selector + " [name=text]";
this.submitButton = this.selector + " [type=submit]";
}
module.exports = new SearchBox();
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
"use strict";
class Queue {
constructor() {
this.top = Promise.resolve();
}
push(operation) {
return this.top = this.top
.then(() => this.delay())
.then(() => operation());
@just-boris
just-boris / run.js
Created December 10, 2015 11:14
Jasmine Program API
var jasmine = new Jasmine();
jasmine.loadConfig({
spec_dir: 'src',
spec_files: [
'js/**/*.spec.js'
],
helpers: ['spec/bootstrap.js']
});
jasmine.onComplete(function(passed) {
done(passed ? null : 'Some tests has been failed');
@just-boris
just-boris / index.js
Created January 21, 2016 10:15
Handlebars loader for node.js
const fs = require('fs');
const path = require('path');
const Handlebars = require('handlebars/dist/cjs/handlebars');
// configuration the same as webpack handlebars-loader has
const config = {
helperDirs: [
path.resolve(__dirname, '../src/helpers'),
path.resolve(__dirname, '../src/blocks')
]
@just-boris
just-boris / .gitignore
Last active March 5, 2016 08:07
Redux#1468
node_modules/
dist/
@just-boris
just-boris / package.json
Created April 10, 2016 21:05
Reproduce issue with postcss-modules and cssnano
{
"name": "postcss-bug",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",