Skip to content

Instantly share code, notes, and snippets.

Jerónimo Carrizo Jero786

Block or report user

Report or block Jero786

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
@Jero786
Jero786 / react live templates webstorm
Last active Jun 15, 2019
Webstorm - Live Templates
View react live templates webstorm
// rt
render(<$ELEMENT$ $ATTRIBUTE$='$TEXT$'/>).getByText(/$TEXT$/);
$END$
// itrt
it('should render properly the $ATTRIBUTE$ value', () => {
render(<$ELEMENT$ $ATTRIBUTE$='$TEXT$'/>).getByText(/$TEXT$/);
});
$END$
@Jero786
Jero786 / gist:bdde50951756b0ab3deafa6bd634274b
Created Jun 13, 2019
NodeJS + Mongoose + Mongoose-Crudify
View gist:bdde50951756b0ab3deafa6bd634274b
const express = require('express');
const mongoose = require('mongoose');
const mongooseCrudify = require('mongoose-crudify');
const app = express();
const bodyParser = require('body-parser');
const PORT = process.env.PORT || 3000;
mongoose.connect('mongodb://localhost/demo', {useNewUrlParser: true})
.then(() => console.log('Connection successfull'))
.catch(err => console.error(err));
View Mongoose, add new Blog!
const express = require('express');
const mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/demo', {useNewUrlParser: true})
.then(() => console.log('Connection successfull'))
.catch(err => console.error(err));
const BlogSchema = mongoose.Schema({
name:String,
email:String,
View gist:8189f6f28f99a209c14d73760bc19495
/**
* Given a array of array values, will return a new instance with a flatten array.
*
* @param {Array} The array which will be flatten
* @param {Array} The new flatten array (private)
* @param {number} A position index that use to traverse given array. (private)
* @return {Array} The new array flatten
* @public
*/
function flatten(numbers, result, index) {
You can’t perform that action at this time.