Skip to content

Instantly share code, notes, and snippets.

💭

Nelreina nelreina

💭
  • Willemstad, Curacao
Block or report user

Report or block nelreina

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View pom.xml
...<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 -->
View mongodb-client
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();
})();
View asaw.json
"Async Anonymous Call": {
"prefix": "asaw",
"body": [
"(async () => {",
" const ret = await ${1:methodName}",
" ${2}",
"})();"
],
"description": "Async Anonymous Call"
}
View .eslintrc
module.exports = {
parser: 'babel-eslint',
env: {
browser: true,
commonjs: true,
es6: true,
node: true,
jest: true,
},
extends: ['eslint:recommended', 'plugin:react/recommended'],
View .js
{
"presets": ["env"],
"plugins": ["transform-object-rest-spread"]
}
@nelreina
nelreina / run-x-times.sql
Created Aug 23, 2017
run-insert-statement-x-number-of-times
View run-x-times.sql
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
View AdditonalSnippets
"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"
},
View rootReducer.js
import { combineReducers } from 'redux';
export default combineReducers({
default: (state ={}, action) => state
})
@nelreina
nelreina / hot-reload.js
Created Dec 3, 2016
create-react-app hot reload script goes in index.js
View hot-reload.js
if (module.hot) {
module.hot.accept('./App', _ => {
const App = require('./App').default;
ReactDOM.render(
<App />,
document.getElementById('root')
);
})
}
You can’t perform that action at this time.