- Clear feature ownership
- Module usage predictibility (refactoring, maintainence, you know what's shared, what's not, prevents accidental regressions, avoids huge directories of not-actually-reusable modules, etc)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
IFS=$'\n\t' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
#swaSearch.py | |
#Southwest Air Fare Searcher | |
# | |
# | |
#Default Aiports: | |
departureAirportCode = "LAX" | |
arrivalAirportCode = "SJC" | |
#departureDate= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const unary = (fn) => | |
fn.length === 1 | |
? fn | |
: function (something) { | |
return fn.call(this, something) | |
} | |
['1', '2', '3'].map(unary(parseInt)) | |
//=> [1, 2, 3] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#puck.sh | |
# A DNS propagation checker. Fetches in many DNS servers around | |
# the world for IPs assigned to a given domain. | |
# | |
# Author: José Lopes de Oliveira Júnior <http://joselop.es> | |
# | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const callerMap = {}; | |
function getCaller(error) { | |
if (error && error.stack) { | |
const lines = error.stack.split('\n'); | |
if (lines.length > 2) { | |
let match = lines[2].match(/at ([a-zA-Z\-_$.]+) (.*)/); | |
if (match) { | |
return { | |
name: match[1].replace(/^Proxy\./, ''), |
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');
Those suck for maintenance and they're ugly.