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
#user nobody; | |
worker_processes 4; | |
#error_log logs/error.log; | |
#error_log logs/error.log notice; | |
#error_log logs/error.log info; | |
#pid logs/nginx.pid; |
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
https://tproger.ru/translations/aws-in-plain-russian/ |
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 EventEmitter = require('events'); | |
class MyEmitter extends EventEmitter { | |
constructor() { | |
super(); //must call super for "this" to be defined. | |
} | |
} | |
const myEmitter = new MyEmitter(); | |
myEmitter.on('event', () => { |
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
https://mochajs.org/ | |
describe('hooks', function() { | |
before(function() { | |
// runs before all tests in this block | |
}); | |
after(function() { | |
// runs after all tests in this block |
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 setTm = (cb) => { | |
setTimeout(() => { | |
cb() | |
console.log('setTimeout'); | |
}, 0); | |
} | |
const setIm = (cb) => { | |
setImmediate(() => { | |
cb() |
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
#!/usr/bin/env perl | |
use Modern::Perl; | |
use Mojo::UserAgent; | |
use Mojo::IOLoop; | |
use Mojo::URL; | |
# FIFO queue | |
my $seed_url = 'http://www.google.co.uk/'; | |
my @urls = ($seed_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
const waitFor = (ms) => new Promise(r => setTimeout(r, ms)) | |
async function asyncForEach(array, callback) { | |
for (let index = 0; index < array.length; index++) { | |
await callback(array[index], index, array) | |
} | |
} | |
asyncForEach([1, 2, 3], async (num) => { | |
await waitFor(50) |
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
.evaluate(function (localConfig, done) { | |
var element = document.querySelector(localConfig.auth.alertDiv), content; | |
done(); | |
}, localConfig); |
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
/* | |
* Получение мобильных useragent с сайта https://developers.whatismybrowser.com/useragents/explore/operating_system_name/android | |
* с каждой страницы выдирает ua для мобилок | |
* после прохода по всем страницам - сохраняет в текущей директории в json | |
* | |
* */ | |
const fs = require('fs'), | |
jsonfile = require('jsonfile'), | |
Nightmare = require('nightmare'); |
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
.evaluate(function (localConfig, done) { | |
var element = document.querySelector(cssPath); | |
if(!element) { | |
// попадет в catch в promise | |
done("No element"); | |
return; | |
} | |
... |