Skip to content

Instantly share code, notes, and snippets.

Avatar
🤓
"We shall never surrender!"

Carles Alcolea nmaxcom

🤓
"We shall never surrender!"
View GitHub Profile
View keybinding.json
[
// Place your key bindings in this file to overwrite the defaults
/* From the website:
* To remove a specific key binding, add a - to the command and
* the rule will be a removal rule.
*/
{
"key": "alt+cmd+l",
"command": "editor.action.formatDocument",
"when": "editorTextFocus && !editorReadonly"
@nmaxcom
nmaxcom / gulpfile.js
Created Nov 1, 2018
How to make a Gulpfile use different inputs and outputs keeping DRY?
View gulpfile.js
/*
This is the barebones proof of concept:
*/
const gulp = require('gulp');
const p = {
dashboard: {
orig: ['public/dashboard/scss/style.scss', 'public/dashboard/styles/*.css'],
dest: 'public/dashboard/css/',
View webpack.config.js
const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const devMode = process.env.NODE_ENV !== 'production';
module.exports = {
entry: 'multi-entry-loader!',/* {
app: ['./app.js', './public/styles/custom.scss', './public/styles/*.css'],
dashboard: ['./public/dashboard/scss/style.scss'],
}, */
output: {
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>weakPoint algo testing</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
View Composition & concatenative inheritance.js
-- Human.js -----------------------------------------------------
const Human = () => ({
name:'',
health: 100,
energy: 100,
hunger: 0,
age: 30,
changeProp: function(pair) {
this[Object.keys(pair)[0]] = Object.values(pair)[0];
@nmaxcom
nmaxcom / gulpfile.js
Created Nov 12, 2015
The one that I use for now, always in constant change... (about to add PostCSS)
View gulpfile.js
var autoprefixer = require('gulp-autoprefixer');
var browserSync = require('browser-sync');
var concat = require('gulp-concat');
var del = require('del');
var gulp = require('gulp');
var htmlmin = require('gulp-htmlmin');
var kit = require('gulp-kit');
var merge = require('merge-stream');
var minifycss = require('gulp-minify-css');
var nano = require('gulp-cssnano');
You can’t perform that action at this time.