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
CREATE TABLE Customers | |
( | |
Id INT IDENTITY(1,1) NOT NULL, | |
Name NVARCHAR(255) NOT NULL | |
); | |
GO | |
SET IDENTITY_INSERT Customers OFF; |
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
void Main() | |
{ | |
IAreaComputable circle = new Сircle(5); | |
IAreaComputable square = new Square(5); | |
Quadrilateral rhombus = new Rhombus(5, 7); | |
circle.ComputeArea().Dump(); | |
square.ComputeArea().Dump(); | |
((IAreaComputable)rhombus).ComputeArea().Dump(); | |
} |
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
// Read to end first, then solve one by one. | |
var express = require('express'); | |
// #0. Load 'multer' here. | |
// #1. Use 'uploads' folder for multer's upload here. | |
var app = express(); |
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 handleErrors = (err) => { console.error(err); return null } | |
const wrap = (f) => | |
(...args) => | |
( | |
( | |
async () => f(...args) | |
)() | |
).catch(handleErrors) |
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
a = a.map(x => ({id: x.id, fids: x.friendsIds})) | |
data = {} | |
data.nodes = a.map(x => ({ id: x.id })) | |
data.links = a.reduce((acc, cur) => { | |
const links = cur.fids.map(x => ({ source: cur.id, target: x })) | |
return acc.concat(links) | |
}, []) |
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 strict' | |
const crypto = require('crypto') | |
const secret1 = 'appsecret' | |
const payload1 = { | |
algorithm: 'HMAC-SHA256', | |
expires: 1291840400, | |
issued_at: 1291836800, |