const numbers = [1, 2, 3, 4, 5, 6, 7, 8];
let c = 0;
numbers.forEach(i1 => {
numbers.forEach(i2 => {
numbers.forEach(i3 => {
numbers.forEach(i4 => {
const uniqueNumbers = [...new Set([i1, i2, i3, i4])];
if (uniqueNumbers.length === 4) {
console.log(uniqueNumbers);
c++;
}
})
})
})
});
console.log(c);
const { Builder, By, Key, until } = require('selenium-webdriver');
(async function example() {
let driver = await new Builder().forBrowser('firefox').usingServer('http://localhost:4444/wd/hub').build();
try {
await driver.get('http://www.google.com/ncr');
await driver.findElement(By.name('q')).sendKeys('webdriver', Key.RETURN);
await driver.wait(until.titleIs('webdriver - Google Search'), 1000);
} finally {
await driver.quit();
}
})();
const fetch = require('node-fetch');
fetch('https://httpbin.org/delete', {
method: 'DELETE',
headers: {
"teacherId": 8
}
})
.then(res => res.text())
.then(text => {
console.log(text);
});
/usr/local/bin/node /Users/evgenij/projects/fetch.js
{
"args": {},
"data": "",
"files": {},
"form": {},
"headers": {
"Accept": "*/*",
"Accept-Encoding": "gzip,deflate",
"Host": "httpbin.org",
"Teacherid": "8",
"User-Agent": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)",
"X-Amzn-Trace-Id": "Root=1-5e99af90-fe7e43f7f3d1149a814fd762"
},
"json": null,
"origin": "*******",
"url": "https://httpbin.org/delete"
}
select `id` from `table` where (SELECT @s:= @s + `size` from (SELECT @s:= 0) s) < 1000000 order by `id` desc ;
location ~ ^/xml/(.+)$ {
rewrite ^/xml/(.+)$ /$1 break;
proxy_pass https://httpbin.org;
}
const axios = require('axios');
const qs = require('qs');
const token = '***************';
const url = `https://api.vk.com/method/users.get?access_token=${token}&v=5.103`;
const ids = Array.from({ length: 1000 }, (v, k) => k + 1);
const post = { 'user_ids': ids.join(',') };
(async () => {
const response = await axios({
method: 'post',
url: url,
data: qs.stringify(post),
headers: { 'content-type': 'application/x-www-form-urlencoded' }
});
console.log(response.data);
})();
<?php
$redis = new Redis();
$redis->connect('127.0.0.1', 6379);
$redis->hSet("REDIS_BIG_KEY", 1991, 1);
$redis->hSet("REDIS_BIG_KEY", 1992, 2);
var_dump($redis->hGetAll('REDIS_BIG_KEY'));
$redis->del('REDIS_BIG_KEY');
var_dump($redis->hGetAll('REDIS_BIG_KEY'));
/*
array(2) {
[1991]=>
string(1) "1"
[1992]=>
string(1) "2"
}
array(0) {
}
*/
127.0.0.1:6379> hgetall REDIS_BIG_KEY
1) "1991"
2) "1"
3) "1992"
4) "2"
127.0.0.1:6379> hgetall REDIS_BIG_KEY
(empty list or set)
127.0.0.1:6379>
relayhost = [smtp.mailgun.org]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = static:postmaster@mydomain.com:password
smtp_sasl_security_options = noanonymous