Skip to content

Instantly share code, notes, and snippets.

View nikosantis's full-sized avatar
🏠
Working from home Chile

Nikolas Santis nikosantis

🏠
Working from home Chile
View GitHub Profile
@nikosantis
nikosantis / eslintrc
Created October 10, 2019 14:06 — forked from gndx/eslintrc
{
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": ["airbnb"],
"globals": {
"document": false,
"escape": false,
@nikosantis
nikosantis / gitignore
Created October 10, 2019 14:09 — forked from gndx/gitignore
# Node template
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
{
"initalState": {
"mylist": [],
"trends": [
{
"id": 2,
"slug": "tvshow-2",
"title": "In the Dark",
"type": "Scripted",
"language": "English",
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@nikosantis
nikosantis / ES6
Created February 12, 2020 01:12
Object.assing, spread operator
const perfil = {
nombre: 'Nikolas',
info: {
direccion: 'Nataniel Cox 1200'
}
}
const region = {
pais: 'Chile',
info: {
////////////////////////////////////////////////////////////////////////////////
// Welcome to @reach/tooltip!
//
// Quick definitions:
//
// - "on rest" or "rested on": describes when the element receives mouse hover
// after a short delay (and hopefully soon, touch longpress).
//
// - "activation": describes a mouse click, keyboard enter, or keyboard space.
//
@nikosantis
nikosantis / mq.js
Created March 25, 2020 21:23
Media queries for Styled Components
import { css } from 'styled-components'
const breakpoints = {
xs: '480px',
sm: '768px',
md: '992px',
lg: '1200px'
}
export const MQ = Object.keys(breakpoints).reduce((accumulator, label) => {
const joi = require('@hapi/joi')
const taskSchema = {
name: joi.string().required(),
description: joi.string().required()
}
module.exports = {
taskSchema
}
const boom = require('@hapi/boom');
const joi = require('@hapi/joi');
function validate(data, schema) {
const { error } = joi.validate(data, schema);
return error;
}
function validationHandler(schema, check = 'body') {
return function(req, res, next) {
const connectDB = require('./db')
const { ObjectID } = require('mongodb')
module.exports = {
createTask: async ({ task }) => {
const inputTask = Object.assign(task)
let db
let newTask
try {