Skip to content

Instantly share code, notes, and snippets.

Avatar

Johnny Wu wxs77577

View GitHub Profile
View nest-init.md

{ "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",

@wxs77577
wxs77577 / main
Created Jun 3, 2020
vscode-settings
View mongoose-crud.service.ts
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()
}
View shell.md
curl -sL https://rpm.nodesource.com/setup_10.x | bash -
@wxs77577
wxs77577 / express-async.js
Created Aug 4, 2017
Express with Async Mongodb
View express-async.js
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())
@wxs77577
wxs77577 / qzw.js
Last active Aug 3, 2017
【NodeJS】找出千字文(简体版)中重复的字
View qzw.js
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);
}
})
@wxs77577
wxs77577 / swiper-zoomable-pagination.html
Last active Mar 15, 2017
Swiper Zoomable (Scalable) Pagination
View swiper-zoomable-pagination.html
<!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{
@wxs77577
wxs77577 / goto-sublime
Created Sep 26, 2016 — forked from kendellfab/goto-sublime
Add mouse click `goto definition` in sublime text 3.
View goto-sublime
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",
You can’t perform that action at this time.