{ "name": "nest-test", "version": "0.0.1", "description": "", "author": "", "license": "MIT", "scripts": { "build": "tsc -p tsconfig.build.json", "format": "prettier --write "src//*.ts" "test//.ts" "libs/**/.ts"", "start": "ts-node -r tsconfig-paths/register src/main.ts",
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 FormData from 'form-data' | |
import { readFileSync } from 'fs' | |
import fetch from 'node-fetch' | |
const url = 'https://test.com/api' | |
const name = 'avatar' | |
const file = readFileSync('./avatar.jpg') | |
const form = new FormData() |
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
test |
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 { ModelType } from "@hasezoey/typegoose/lib/types"; | |
import { CrudRequest, CreateManyDto, GetManyDefaultResponse, CrudService } from "@nestjsx/crud"; | |
import { BadRequestException, NotFoundException } from "@nestjs/common"; | |
import { mongoose } from "@hasezoey/typegoose"; | |
export class MongooseCrudService<T> extends CrudService<T> { | |
constructor(public model: ModelType<T>) { | |
super() | |
} |
curl -sL https://rpm.nodesource.com/setup_10.x | bash -
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 MongoClient = require('mongodb').MongoClient | |
const express = require('express') | |
const multer = require('multer') | |
const bodyParser = require('body-parser') | |
const upload = multer({ dest: 'uploads/' }) | |
const router = express.Router() | |
const app = express() | |
app.use(bodyParser.json()) |
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
require('fs').readFileSync('qzw.txt', 'utf-8') | |
.replace(/\s+/g, '') | |
.split('') | |
.sort((a, b) => { | |
return a.charCodeAt() - b.charCodeAt() | |
}).forEach((v, k, arr) => { | |
if (k > 1 && v === arr[k - 1]) { | |
console.log(v); | |
} | |
}) |
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"> | |
<title>Document</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<meta name="author" content="http://github.com/wxs77577"> | |
<link href="https://cdn.bootcss.com/Swiper/3.4.1/css/swiper.css" rel="stylesheet"> | |
<style> | |
.swiper-slide{ |
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
Linux - create "Default (Linux).sublime-mousemap" in ~/.config/sublime-text-3/Packages/User | |
Mac - create "Default (OSX).sublime-mousemap" in ~/Library/Application Support/Sublime Text 3/Packages/User | |
Win - create "Default (Windows).sublime-mousemap" in %appdata%\Sublime Text 3\Packages\User | |
[ | |
{ | |
"button": "button1", | |
"count": 1, | |
"modifiers": ["ctrl"], | |
"press_command": "drag_select", |