Skip to content

Instantly share code, notes, and snippets.

View alexcorre's full-sized avatar

Alex Corre alexcorre

  • Los Angeles, CA
View GitHub Profile
@alexcorre
alexcorre / npm_token.sh
Created August 17, 2017 21:28
export NPM_TOKEN in your shell
# add the following somewhere your shell will source .bash_profile, .bashrc, .zshrc, etc.
export NPM_TOKEN=$(cat ~/.npmrc | sed 's/.*authToken=\(.*\)/\1/')
/*
Challenge: Write a function that checks if all the zeros of an array are at the
end (an array with no zeros in it does have all its zeros at the end). An empty
array also has all its zeros at the end.
The function should run in O(n) time, and it's okay if it always runs in O(n).
The objective here is "elegance" (ease of reading the code), not
performance.
Inspired by this real world Ruby discussion: