Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mburakerman
mburakerman / package.json
Last active April 6, 2018 08:54
Webpack 4 config.js (Postcss and Babel) 👌 The Simplest Usage 👌
{
"name": "webpack-postcss,
"version": "1.0.0",
"scripts": {
"start": "webpack-dev-server --open --mode development",
"build": "webpack -p"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.4",
@mburakerman
mburakerman / package.json
Last active November 19, 2025 15:18
Webpack 4 config.js (SCSS to CSS and Babel) 👌 The Simplest Usage 👌
{
"name": "webpack-sass",
"version": "1.0.0",
"scripts": {
"start": "webpack-dev-server --open --mode development",
"build": "webpack -p"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.4",
@mburakerman
mburakerman / lib.js
Created June 24, 2017 12:49
Node.js module exports and require
let person = {
age:23,
name:"Mehmet Burak Erman",
show: function() {
return this.name;
}
}
function foo() {
@mburakerman
mburakerman / es6.js
Last active September 14, 2024 10:05
Es6 In a Nutshell
// 1:)let
var name = "burak";
console.log(name);
//or use let
let name2 = "burak2";
console.log(name2);
// Why we would use let instead of var?
/* In js, there is global and local scope but js doesn't really have a
@mburakerman
mburakerman / defaultProps.jsx
Last active August 1, 2018 02:30
defaultProps ES6 Syntax in React.js
// https://github.com/facebook/react/issues/3725
...
static get defaultProps() {
return {
count:1
}
}
....
@mburakerman
mburakerman / gulpfile.js
Last active September 12, 2018 08:12
Getting Started with Gulp.js
/*
LIVE RELOAD ✔
SCSS TO CSS ✔
MINIFY CSS ✔
PREFIX CSS ✔
MINIFY JS ✔
TRANSPILE JS ✔
*/
var gulp = require("gulp");
@mburakerman
mburakerman / plugin.js
Last active July 28, 2023 07:07
The simplest vanilla js plugin template
// <div id="box">Lorem</div>
// Our goal is to make text color red
var Makered = function(selector) {
this.el = document.querySelector(selector); // for multiple elements use querySelectorAll
}
Makered.prototype.makered=function() {
this.el.style.color="red";
}