Skip to content

Instantly share code, notes, and snippets.

Nicholas Cloud nicholascloud

Block or report user

Report or block nicholascloud

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@nicholascloud
nicholascloud / global-npm-packages.md
Last active Mar 29, 2019
Global npm tools/packages that I use
View global-npm-packages.md

Version control

  • git-open - Type git open to open the repo website (GitHub, GitLab, Bitbucket) in your browser.
  • git-recent - List recent git branches, formatted so fancy

JavaScript development

  • eslint - ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code.
  • jake - the JavaScript build tool for Node.js
@nicholascloud
nicholascloud / nvm-outdated.sh
Created Dec 11, 2017
check all outdated global packages in all versions of node.js installed by nvm
View nvm-outdated.sh
nvmOutdated() {
CURRENT="$(nvm current)"
for v in `ls -1 ~/.nvm/versions/node/`; do
nvm use $v
npm -g outdated
done
nvm use $CURRENT
}
alias nvm-outdated="nvmOutdated"
@nicholascloud
nicholascloud / .bashrc
Last active Sep 21, 2017
bash - override cd to test for .nvmrc and instruct nvm to change node versions if present
View .bashrc
# hook into the cd command to test for the presence
# of .npmrc and then switch node versions based on that
cd() {
builtin cd "$@"
if [ -d $NVM_DIR ]
then
if [ -f ./.nvmrc ]
then
# cat ./.nvmrc
LOCAL_NODE_VERSION=`cat .nvmrc`
@nicholascloud
nicholascloud / JobData.cs
Last active Mar 12, 2017 — forked from ajtrujillo/JobData.cs
TechJobsConsoleJobData FindbyValue
View JobData.cs
public static List<Dictionary<string, string>> FindbyValue(string searchTerm)
{
LoadData();
List<Dictionary<string, string>> jobs = new List<Dictionary<string, string>>();
foreach (Dictionary<string, string> row in AllJobs) {
if (row.ContainsValue(searchTerm))
{
@nicholascloud
nicholascloud / JobData.cs
Created Mar 12, 2017 — forked from ajtrujillo/JobData.cs
TechJobsConsoleJobData FindbyValue
View JobData.cs
public static List<Dictionary<string, string>> FindbyValue(string searchTerm)
{
LoadData();
List<Dictionary<string, string>> jobs = new List<Dictionary<string, string>>();
foreach (Dictionary<string, string> row in AllJobs)
if (row.ContainsValue(searchTerm))
{
View tribalism.md

This is a summary and response to Chris Ammerman (@cammerman) re: a twitter thread that I (@nicholascloud) initiated with this post. I will state my intended point, summarize the point I believe that Chris has made, and then offer a more long-form response as Twitter is simply not conducive to such discussions.

First, the following quote, which constitutes the bulk of my initial post:

Ayn Rand on Tribalism

My intention when posting this was simply to offer Rand's commentary on the growing tendency of people to segregate themselves into "tribes" based on birth culture, or "ethnicity". I do not believe that Rand here refers to food, music, dress, or other minor cultural rituals which everyone adopts by default, but rather to the brand of identity politics that have become common means of social organization. So common, in fact, that people now form tribes around religion, sexual orientatio

@nicholascloud
nicholascloud / browserified.txt
Created Mar 19, 2015
Browserified (a parody of Stupify)
View browserified.txt
Browserified (a parody of Stupify https://www.youtube.com/watch?v=mjKY3gg4T3Q)
---
Yeah, bringing you another disturbing code base
from the mind of one sick dev who can't tell the difference
and gets minified
I've been waiting my whole life for just one func
And all I needed was just one func
View keybase.md

Keybase proof

I hereby claim:

  • I am nicholascloud on github.
  • I am nicholascloud (https://keybase.io/nicholascloud) on keybase.
  • I have a public key whose fingerprint is DF3F 9766 2F62 102E E308 7908 88A3 3381 C7CC 0B54

To claim this, I am signing this object:

View blog-npm-root-packages.md

The problem

When I list my npm packages with npm ls -g (or without the -g option for a local node_modules directory) I see all installed packages and their dependencies. Like so:

$ npm ls -g
├─┬ anvil.js@0.9.0-RC3.1
│ ├── colors@0.6.0
│ ├─┬ commander@1.1.1
│ │ └── keypress@0.1.0
@nicholascloud
nicholascloud / so-240258-prune-byte-array.cs
Last active Sep 1, 2016
prune trailing null entries in byte array
View so-240258-prune-byte-array.cs
//see http://stackoverflow.com/questions/240258/removing-trailing-nulls-from-byte-array-in-c-sharp
static class ByteArrayExtensions {
public static Byte[] Prune(this Byte[] bytes) {
if (bytes.Length == 0) return bytes;
var i = bytes.Length - 1;
while (bytes[i] == 0) {
i--;
}
Byte[] copy = new Byte[i + 1];
You can’t perform that action at this time.