This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function timeout(time = 1000) { | |
return new Promise(resolve => setTimeout(resolve, time, time)) | |
} | |
async function testWhile(count) { | |
let i = -1 | |
while (++i < count) { | |
const res = await timeout(i * 1000) | |
console.log({ res, i }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## build image | |
docker build -t tyllo/$name . | |
## run image with volume | |
params='-it -p 8080:8080 -p 8888:8888 -v `cygpath -d $PWD`:"$PWD" -w "$PWD"' | |
docker run $params --name test tyllo/name bash | |
## start container id | |
docker start #name-container |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param {string} string | |
* @param {string} prefix | |
* @return {Generator<string>} | |
*/ | |
function *permutationGenerator(string, prefix = '') { | |
if (!string) { | |
yield prefix; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Convert binary to decimal number | |
* @param {string} binary | |
*/ | |
function binaryToDecimal(binary) { | |
return binary.split('').reverse().reduce((summa, char, i) => { | |
return char === '0' ? summa : summa + Math.pow(2, i) | |
}, 0) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Register | |
class VerifyEmail < RegisterBase | |
def call | |
context.fail! if context.validation_fail | |
url = resource_url + '/verification?verification_code=' | |
url += URI.escape(context.verification_code) if context.verification_code | |
result = make_request(::Utils::Stubs.verify_email, :post, url) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PaginationDirective { | |
constructor () { | |
this.restrict = 'E' | |
this.replace = true | |
this.templateUrl = 'common/directives/mb-pagination' | |
this.scope = { | |
currentPage: '=', | |
countPage: '=', | |
selectPage: '=', | |
url: '=' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { moduleForComponent, test } from 'ember-qunit'; | |
import hbs from 'htmlbars-inline-precompile'; | |
moduleForComponent('event-list-item', 'Integration | Component | event list item', { | |
integration: true | |
}); | |
test('it renders', function(assert) { | |
this.set('model', { meta: {} }); | |
this.set('camera', { id: 'test' }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as EventUtils from 'frontend/utils/event'; | |
import { module, test } from 'qunit'; | |
const i18n = { locale: 'en', t: trigger => trigger }; | |
module('Unit | Utility | event - generateTitle'); | |
test('it exists', function(assert) { | |
assert.ok(EventUtils.generateTitle); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var | |
sass = require('gulp-sass'), | |
sourcemaps = require('gulp-sourcemaps'), | |
plumber = require('gulp-plumber'), | |
settings = { | |
outputStyle: 'compressed', | |
includePaths: [] | |
}; |