Skip to content

Instantly share code, notes, and snippets.

View nmaxcom's full-sized avatar
🙃

Neithan nmaxcom

🙃
  • Barcelona, Spain
View GitHub Profile
@nmaxcom
nmaxcom / gist:76f97f51b23c8b535520afa580db1205
Created November 1, 2022 11:54
More concise way of pushing only a few obj keys into an array
const bigObj = {
title: "BLabla",
text: "sda nasd asld asdjas dsa dlajsd sdjdalsdj dasjd asdkj",
bu: "kjjk",
bla: 32,
image: "https://www.blup.com/blabla.png",
};
let arr = [];
@nmaxcom
nmaxcom / GoogleSearchSelected.user.js
Created January 2, 2021 11:28
UserScript to quickly search terms or open non href'd websites
const log = (msg) =>
console.log(
`%c*SearchScript*: ${msg}`,
"color:white;background-color:#20A6E8;padding:3px"
);
const URIregx = /^((?:https?:\/\/)?(?:[\w-]+\.)+(\w+)\/?([\w-.?=&+%\@\:]+\/?)*)$/i,
KEYCODE_FOR_NEWTAB = 79, // `o` key
KEYCODE_FOR_SAMETAB = 78; // `n` key
[
// 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 November 1, 2018 14:18
How to make a Gulpfile use different inputs and outputs keeping DRY?
/*
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/',
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: {
@nmaxcom
nmaxcom / index.html
Last active March 1, 2018 06:36
weakPoint algo testing (http://jsbench.github.io/#ef33fdd559d26ebe6503047a603ff3fc) #jsbench #jsperf
<!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>
-- 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 / README.md
Created October 1, 2017 07:03 — forked from hofmannsven/README.md
My simply MySQL Command Line Cheatsheet
@nmaxcom
nmaxcom / gulpfile.js
Created November 12, 2015 20:42
The one that I use for now, always in constant change... (about to add PostCSS)
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');