These rules are adopted from the AngularJS commit conventions.
This file contains hidden or 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
go run $GOROOT/src/crypto/tls/generate_cert.go --host="localhost" |
This file contains hidden or 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
changeMac() { | |
local net=${1:-en0} | |
local mac=$(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//') | |
sudo ifconfig $net ether $mac | |
sudo ifconfig $net down | |
sudo ifconfig $net up | |
echo "Your new physical address for interface $net is $mac" | |
} |
This file contains hidden or 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 O = { | |
map: <T, R>(object: T, mapper: (object: T) => R) => mapper(object), | |
} | |
const v = O.map( | |
{foo: 'bar', bar: 'foo', poop: ':)', num: 1}, | |
({ poop, num }) => ({ poop, num }), | |
); |
This file contains hidden or 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/sh | |
IPV4_OCTET_MAX_BITS=256 | |
IPV4_OCTET_MAX_VALUE=255 | |
net_ips_per_mask() { | |
local mask=$1 | |
local bitsleft=$((32-$mask)) | |
local ips=$((2**$bitsleft)) |
This file contains hidden or 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/sh | |
concurrently() { | |
for cmd in "$@"; do | |
echo "Process \"$cmd\" started" | |
$cmd & pid=$! | |
pids="$pids $pid" | |
done | |
trap "kill $pids" INT |
This file contains hidden or 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/sh | |
# Check this answer for more advanced stuff: https://stackoverflow.com/a/28466267/2502746 | |
while getopts "*-:" arg; do | |
case $arg in | |
- ) LONG_OPTARG="${OPTARG#*=}" | |
case $OPTARG in | |
only-foo ) ONLY_FOO=1 ;; | |
only-bar ) ONLY_BAR=1 ;; |
Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.
This solution fixes the error caused by trying to run npm update npm -g
. Once you're finished, you also won't need to use sudo
to install npm modules globally.
Before you start, make a note of any globally installed npm packages. These instructions will have you remove all of those packages. After you're finished you'll need to re-install them.