This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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 fs = require('fs'); | |
const request = require('request'); | |
fs.readFile('./config.json', 'utf-8', (err, data) => { | |
if (err) { | |
throw new Error(err); | |
} | |
request('http://www.google.com', (error, response, body) => { | |
console.log('statusCode:', response.statusCode); // Print the response status code if a response was received | |
}); |
This file contains 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 net = require('net'); | |
const client = new net.Socket(); | |
client.connect(9191, '127.0.0.1', function() { | |
console.log('Connected'); | |
client.write('2 + 4'); | |
}); | |
client.on('data', function(data) { | |
console.log('Received: ' + data); | |
client.destroy(); // kill client after server's response |
This file contains 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
.transition { | |
transition: transform .294s cubic-bezier(.19,1,.22,1); | |
} |
This file contains 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 QR8bitByte(e) { | |
this.mode = QRMode.MODE_8BIT_BYTE; | |
this.data = e | |
} | |
function QRCode(e, t) { | |
this.typeNumber = e; | |
this.errorCorrectLevel = t; | |
this.modules = null; | |
this.moduleCount = 0; | |
this.dataCache = null; |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, user-scalable=no, viewport-fit=cover"> | |
<meta name="theme-color" content="#000000"> | |
<meta content="IE=Edge" http-equiv="X-UA-Compatible"> | |
<title>VK App Demo</title> | |
</head> | |
<body> |
This file contains 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 'core-js/es6/map'; | |
import 'core-js/es6/set'; | |
import connect from '@vkontakte/vkui-connect'; | |
// Init VK App | |
connect.subscribe((e) => { | |
switch (e.detail.type) { | |
case 'VKWebAppGetUserInfoResult': | |
console.log('User: \n', e.detail.data); | |
break; |
This file contains 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 'core-js/es6/map'; | |
import 'core-js/es6/set'; | |
import connect from '@vkontakte/vkui-connect'; | |
connect.send('VKWebAppInit', {}); |
This file contains 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 VKConnect from '@vkontakte/vkui-connect'; | |
VKConnect.send('VKWebAppInit'); | |
if (VKConnect.supports('VKWebAppCallAPIMethod')) { | |
VKConnect.send('VKWebAppCallAPIMethod'); | |
} else { | |
launchModalDialog('Обновите клиент!'); | |
} |
This file contains 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 crypto = require('crypto') //модуль для криптографии Nodejs | |
const { stringify } = require('querystring') //методы для парсинга строки | |
const url = require('url') | |
const URL = | |
'https://example.com/?vk_user_id=494075&vk_app_id=6736218&vk_is_app_user=1&vk_are_notifications_enabled=1&vk_language=ru&vk_access_token_settings=&vk_platform=android&sign=exTIBPYTrAKDTHLLm2AwJkmcVcvFCzQUNyoa6wAjvW6k', | |
CLIENT_SECRET = 'wvl68m4dR1UpLrVRli' | |
const checkVKQueryParamsSign = params => { |
OlderNewer