Skip to content

Instantly share code, notes, and snippets.

🏔
Soon

Deni Baskovsky qertis

🏔
Soon
Block or report user

Report or block qertis

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@qertis
qertis / dialogflow-example.js
Created Jul 20, 2019
DialogFlow Entity Example
View dialogflow-example.js
const fs = require('fs')
var res = {
"id": "11ab1c11-1111-1111-1111-11c9bb639111",
"name": "EntityIntent",
"isOverridable": true,
"entries": [ // ограничение для DialogFlow 30000
],
"isEnum": true,
"automatedExpansion": false,
View gist:c02dde83c28adad67b96399a1f9db006
/* eslint-disable */
debugger
/* eslint-enable no-debugger */
@qertis
qertis / server.js
Created Feb 16, 2019
Node: Custom Simple Server
View server.js
(async function web() {
const http = require('http');
const url = require('url');
const path = require('path');
const fs = require('fs');
const WEB_PORT = Number(process.env.PORT) || 9000;
http.createServer((req, res) => {
const uri = url.parse(req.url).pathname;
let filename = path.join(process.cwd(), uri);
fs.exists(filename, (exists) => {
@qertis
qertis / nuxt.config.js
Created Jan 21, 2019
Nuxt.js: disable js minification
View nuxt.config.js
...
build: {
extend (config, ctx) {
config.plugins = config.plugins.filter((plugin) => plugin.constructor.name !== 'UglifyJsPlugin')
}
}
...
@qertis
qertis / tagReplacer.js
Created Jan 12, 2019
html body tag replacer
View tagReplacer.js
var jsPathRegex = /="\/_nuxt\/[\s\S]*?(.js)"/g;
`
<div>some</div>
<script src="/_nuxt/vendors.js" ></script>
`.replace(jsPathRegex, (a, b) => a.replace(b, '.js?build=' + 123))
@qertis
qertis / Список_продуктов.json
Created Jan 3, 2019
Список_продуктов.json
View Список_продуктов.json
This file has been truncated, but you can view the full file.
[
{
"picUrl": "http://www.calorizator.ru/sites/default/files/imagecache/product_512/product/7up.jpg",
"name": "7up",
"protein": null,
"fat": null,
"carbohydrate": 8.7,
"kcal": 38
},
@qertis
qertis / gist:29f9a38cb766840c95e5ed0ba11d93ba
Created Sep 10, 2018
Как тестить с помощью команды ab
View gist:29f9a38cb766840c95e5ed0ba11d93ba
ab -n 10000 -c 100 -H "Accept-Encoding: gzip, deflate" http://127.0.0.1:3000/
View nextDay.js
function nextDay (dd = 1) {
let today = new Date()
let outDay = new Date()
outDay.setDate(today.getDate() + dd)
return outDay
}
View mongo.help.txt
use something
# Дропнуть БД
db.dropDatabase();
# Показать все коллекции
db.getCollectionNames()
# Показать все записи
db.getCollection('collectionName').find()
@qertis
qertis / isLandscape.js
Created Jan 11, 2018
Check Landscape Mobile
View isLandscape.js
function isLandscape() {
if (window.matchMedia('(orientation: landscape)').matches) {
return true;
} else if (window.matchMedia('(orientation: portrait)').matches) {
return false;
}
return true;
}
You can’t perform that action at this time.