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 / mongo-export
Created March 14, 2014 16:20
mongo import and export
#!/bin/node
"use strict";
var fs = require('fs'),
exec = require('child_process').exec;
var db = process.argv[2],
out_dir = process.argv[3],
host = process.argv[4] || 'localhost';
@just-boris
just-boris / bower.json
Last active August 29, 2015 14:00
Bower postinstall
{
"name": "my-awesome-package",
"version": "0.0.0",
"dependencies": {
"angular": "1.2.14",
"jquery": "~2.1.0",
"bootstrap": "~3.1.0"
}
}
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.examples</groupId>
<artifactId>allure-junit-variant</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Allure Junit Variant</name>
@just-boris
just-boris / README.md
Last active August 29, 2015 14:03
HTTP auth error reproduce
@just-boris
just-boris / app.js
Created September 26, 2014 16:40
Class on route
//update class on route change
angular.module('myApp', ['ngRoute']).run(function($rootScope, $rootElement) {
var view = angular.element($rootElement[0].querySelector('[ng-view]'));
$rootScope.$on('$routeChangeSuccess', function(event, to, from) {
view.removeClass(from.viewClass).addClass(to.viewClass);
});
});
//define classes while define routes
angular.module('myApp').config(function($routeProvider) {
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<outputDirectory>target/package/</outputDirectory>
<resources>
<resource>
<directory>src</directory>
<includes>
<include>config/**</include>
@just-boris
just-boris / page.js
Last active August 29, 2015 14:10
Page object proposal
function PageFactory(config) {
function Page(element) {
this.element = element;
this.config = config;
this.get = function(key) {
var item = config[key];
if(!item) {
throw new Error('No item named "'+key+'" provided')
}
if(typeof item === 'string') {
@just-boris
just-boris / bear.js
Last active August 29, 2015 14:13
Ym-cat
(function() {
var bear = '<img src="http://placebear.com/g/400/200">';
if(typeof modules !== 'undefined') {
modules.define("bear", function(provide) {
provide(bear);
});
} else {
define('bear', bear);
}
})();
@just-boris
just-boris / a.less
Last active August 29, 2015 14:14
Less var mess
@block: widget-a;
.@{block} {
color: red;
}
@just-boris
just-boris / index.html
Last active August 29, 2015 14:15
CDN or not
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>CDN or not</title>
<script>
if(location.search.indexOf('cdn') > -1) {
document.write(unescape("%3Cscript src='http://yastatic.net/jquery/2.1.3/jquery.min.js' type='text/javascript'%3E%3C/script%3E"));
} else {
document.write(unescape("%3Cscript src='jquery.min.js' type='text/javascript'%3E%3C/script%3E"));