Skip to content

Instantly share code, notes, and snippets.

View nmors's full-sized avatar
⌨️
pressing keys

Nathan Pickworth nmors

⌨️
pressing keys
View GitHub Profile
@nmors
nmors / sort-html-list-with-js-short.js
Last active November 10, 2019 09:52
Sort a HTML list using Javascript
// Exactly the same thing with less code
const myElement = document.querySelector(".office-list");
const officesArray = Array.from(document.querySelectorAll(".office"));
myElement.innerHTML = ''
officesArray
.map(element => element.innerHTML)
.sort()
@nmors
nmors / server.js
Created October 31, 2018 21:55
Express App Composition (The functional programming way)
const Express = require('express')
const _ = require('lodash-fp')
const { userController, userMessagesController, postController, pagesController } = require('./controllers')
const { middleware1, middleware2, errorHandler } = require('./middlewares')
const use = (...middleware) => app => app.use(...middleware)
const setupRoute = _.curry((verb, method, urlParams, resource, controller, app) => app[verb](resource + urlParams, controller[method]))
@nmors
nmors / Async Javascript patterns.js
Last active January 16, 2017 05:06
Javascript patterns
Async Javascript Patterns!
@nmors
nmors / gist:742571c07435fa8e37125dbfec86eb3c
Created September 1, 2016 01:46 — forked from jesusprubio/gist:8f092af4ca252e252eab
Proposal: A Node.js penetration test framework

Proposal: Node.js penetration test framework

Hi guys! Since I started to write Bluebox-ng I've been tracking the different security projects I found written in Node.js. Now we've published the first stable version we think it's the right moment to speak among us (and, of course, everyone interested in it :).

Why?

  • I think we're rewriting the same stuff in our respective projects again and again. For example, almost any tool supports IPv6 because the functions we need are still not present in the Node core and the libraries I found (IMHO) were not enough.
  • There're different projects implementing exactly the same thing, ie: port scanners.
  • We're working in a too new environment, so we need to make it together.