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
const fn1 = async () => { | |
console.log('fn1: started'); | |
const promise = new Promise((resolve, reject) => { | |
setTimeout(() => resolve({ fn1: 'data' }), 1000) | |
}); | |
console.log(await promise); | |
return promise; | |
}; |
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
const currentField = ['0:1', '1:1', '2:1']; | |
function parseItem(item) { | |
return item.split(':').map(Number); // [ x, y ] | |
} | |
function countNeighbours(x, y) { | |
let sum = 0; | |
for(var t = -1; t <= 1; t++){ |
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
λ curl cssunderhood.ru -v | |
* Rebuilt URL to: cssunderhood.ru/ | |
* Trying 2a03:6f00:1::5c35:726b... | |
* TCP_NODELAY set | |
* Connected to cssunderhood.ru (2a03:6f00:1::5c35:726b) port 80 (#0) | |
> GET / HTTP/1.1 | |
> Host: cssunderhood.ru | |
> User-Agent: curl/7.54.0 | |
> Accept: */* | |
> |
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 fs = require('fs'); | |
var text = fs.readFileSync('input.txt', 'utf8'); | |
var data = text.split('\n').map(Number); | |
function count (data) { | |
var counter = 0; | |
for (var i = 0; i < data.length && i >= 0;) { | |
var _i = 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
var fs = require('fs'); | |
var text = fs.readFileSync('input.txt', 'utf8'); | |
var data = text.split('\n'); | |
function isValid(password) { | |
var parts = password.split(' '); | |
var isValid = true; | |
var hash = {}; | |
for (var i = 0; i < parts.length; 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
function spiral (searchable) { | |
var ring = 0; | |
var extreme = 0; | |
for (var i = 1, j = 0; i <= Infinity; i += 2, j++) { | |
if (i * i > searchable) { | |
ring = j; | |
extreme = i; | |
break; | |
} |
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
λ courseraprogramming upload coursera.v2.1.1-3 D3N8dyBiEeecWRJ5VaDnfA sIwfA YNyyO | |
Saving image coursera.v2.1.1-3 to /tmp/coursera.v2.1.1-3.tar... done. | |
INFO:root:Attempting to retrieve new tokens from the endpoint. You will be prompted to authorize the courseraprogramming app in your web browser. | |
INFO:root:About to request new OAuth2 tokens from Coursera. | |
Please visit the following URL to authorize this app: | |
https://accounts.coursera.org/oauth2/v1/auth?access_type=offline&state=b07d25825cae4e679fab40f421475fa0&redirect_uri=http%3A%2F%2Flocalhost%3A9876%2Fcallback&response_type=code&client_id=NS8qaSX18X_Eu0pyNbLsnA&scope=view_profile+manage_graders | |
Mac OS X detected; attempting to auto-open the url in your default browser... | |
127.0.0.1 - - [01/Dec/2017 22:22:42] "GET /callback?state=b07d25825cae4e679fab40f421475fa0&code=uO4rSgNQ7u2Wa48-cVQvKJ4_kx_-YiBpHt8_ExAKdck HTTP/1.1" 200 - | |
About to upload to server: |
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
image: gitlab/dind | |
stages: | |
- build | |
- deploy | |
build: | |
stage: build | |
script: | |
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com |
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 () { | |
var HamiltonianGraph = function (targetName, index, pointsForLevel, cb) { | |
pointsForLevel = pointsForLevel || { | |
points: [], | |
ways: {}, | |
offset: [], | |
step: [], | |
type: '' | |
}; |
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
const multivarka = require('./multivarka'); | |
/** | |
* Получаем соединение | |
* @returns {Collection|MultivarkaConnection|*} | |
* @private | |
*/ | |
function _getMultivarka() { | |
var connection = connection || multivarka | |
.server('mongodb://localhost/testdb') |
NewerOlder