Skip to content

Instantly share code, notes, and snippets.

Overview

Problem statement

Describe the problem you're trying to solve by doing this work.

Proposed work

High-level overview of what we're building and why we think it will solve the problem.

// routes.js
const routes = [
{
path: '/',
component: Home,
exact: true
},
{
path: '/gists',
component: Gists
@oguzhanaslan
oguzhanaslan / package.json
Created October 22, 2018 09:13 — forked from adamreisnz/package.json
Simple pure npm scripts build process
{
"name": "project-name",
"description": "Template for static sites",
"version": "1.0.0",
"homepage": "http://www.project-name.com",
"author": {
"name": "Adam Buczynski",
"url": "http://adambuczynski.com"
},
"license": "UNLICENSED",
@oguzhanaslan
oguzhanaslan / _.everyvsevery.js
Created May 30, 2018 08:33
_.every vs every()
var value = [{a: 30310}, {b: 100303}, {c: 3040494}]
// lodash
_.every(value, (v,i) => {})
// JavaScript
value.every((v,i) => {})
@oguzhanaslan
oguzhanaslan / _.includesvsincludes.js
Last active May 30, 2018 08:06
_.includes vs includes()
var data = ['mustafa', 'kemal', 'atatürk'];
// lodash
_.includes(data, 'kemal');
// JavaScript
data.includes('kemal');
@oguzhanaslan
oguzhanaslan / findvsfind.js
Created May 29, 2018 12:24
find() vs _.find
var users = [
{ 'user': 'oğuzhan', 'age': 36, 'active': true },
{ 'user': 'aslan', 'age': 41, 'active': false },
{ 'user': 'can', 'age': 14, 'active': false },
{ 'user': 'mehmet', 'age': 16, 'active': true },
{ 'user': 'ahmet', 'age': 11, 'active': true },
];
// lodash
_.find(users, function (o) { return o.age < 40; })
@oguzhanaslan
oguzhanaslan / mergevsobjectassign.js
Created May 29, 2018 12:09
_.merge vs Object.assign
var obj1 = { adalet: false }
var obj2 = { barış: false }
var obj3 = { özgürlük: false }
// lodash
_.merge({}, obj1, obj2, obj3)
// JavaScript
Object.assign({}, obj1, obj2, obj3)
@oguzhanaslan
oguzhanaslan / next.config.js
Created January 17, 2018 12:23
next.config.js
// next.config.js
module.exports = {
useFileSystemPublicRoutes: false
}
@oguzhanaslan
oguzhanaslan / server.js
Created January 17, 2018 12:22
server.js
// This file doesn't not go through babel or webpack transformation.
// Make sure the syntax and sources this file requires are compatible with the current node version you are running
// See https://github.com/zeit/next.js/issues/1245 for discussions on Universal Webpack or universal Babel
const { createServer } = require('http')
const { parse } = require('url')
const next = require('next')
const dev = process.env.NODE_ENV !== 'production'
const app = next({ dev })
const handle = app.getRequestHandler()
@oguzhanaslan
oguzhanaslan / package.json
Created January 17, 2018 12:22
package.json
{
"scripts": {
"dev": "node server.js",
"build": "next build",
"start": "NODE_ENV=production node server.js"
}
}