Skip to content

Instantly share code, notes, and snippets.

View nelreina's full-sized avatar
💭

Nelreina nelreina

💭
View GitHub Profile
...<properties> <org.mapstruct.version>1.3.0.Final</org.mapstruct.version></properties>...<dependencies> <dependency> <groupId>org.mapstruct</groupId> <artifactId>mapstruct</artifactId> <version>${org.mapstruct.version}</version> </dependency></dependencies>...<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.5.1</version> <!-- or newer version --> <configuration> <source>1.8</source> <!-- depending on your project --> <target>1.8</target> <!-- depending on your project --> <annotationProcessorPaths> <path> <groupId>org.mapstruct</groupId> <artifactId>mapstruct-processor</artifactId> <version>${org.mapstruct.version}</version> </path> <!-- other annotation processors -->
const {MongoClient} = require( "mongodb");
(async () => {
const client = new MongoClient();
const url = 'mongodb://localhost:27017/test';
const db = await client.connect(url);
console.log(await db.admin().listDatabases());
await db.close();
})();
"Async Anonymous Call": {
"prefix": "asaw",
"body": [
"(async () => {",
" const ret = await ${1:methodName}",
" ${2}",
"})();"
],
"description": "Async Anonymous Call"
}
@nelreina
nelreina / index.js
Last active March 29, 2018 12:34
Redux Store Setup
import React from 'react';
import { render } from 'react-dom';
import App from './App';
import 'babel-polyfill';
import { Provider } from 'react-redux';
import store from './store';
render(
<Provider store={store}>
<App />
</Provider>,
"Require Node Module": {
"prefix": "creq",
"body": ["const ${1:module} = require('${1:module}');"],
"description": "Require Node Module"
},
"Require Local File Node Module": {
"prefix": "cfreq",
"body": ["const ${2:module} = require('.${1:file}');"],
"description": "Require Node Module"
},
module.exports = {
parser: 'babel-eslint',
env: {
browser: true,
commonjs: true,
es6: true,
node: true,
jest: true,
},
extends: ['eslint:recommended', 'plugin:react/recommended'],
import { combineReducers } from 'redux';
export default combineReducers({
default: (state ={}, action) => state
})
{
"presets": ["env"],
"plugins": ["transform-object-rest-spread"]
}
@nelreina
nelreina / run-x-times.sql
Created August 23, 2017 19:23
run-insert-statement-x-number-of-times
create procedure insert_into_b
@numInserts int
as
begin
while @numInserts > 0
begin
insert into b (id)
select id from a
set @numInserts = @numInserts - 1
end