Skip to content

Instantly share code, notes, and snippets.

View nicholascloud's full-sized avatar

Nicholas Cloud nicholascloud

View GitHub Profile
@nicholascloud
nicholascloud / browserified.txt
Created March 19, 2015 15:59
Browserified (a parody of Stupify)
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
@nicholascloud
nicholascloud / blog-historical-object.js
Last active October 2, 2015 17:57
blog-historical-object
//context: http://www.nicholascloud.com/2012/04/historical-javascript-objects/
var historicalObject = (function () {
var _pushProto = function (obj) {
function EmptyObject () {}
EmptyObject.prototype = obj || Object.prototype;
var other = new EmptyObject();
if (other.__version !== undefined) {
other.__version++;

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 / blog-npm-root-packages.md
Last active December 16, 2015 03:49
blog-npm-root-packages

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 September 1, 2016 01:23
prune trailing null entries in byte array
//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];
@nicholascloud
nicholascloud / JobData.cs
Created March 12, 2017 00:22 — forked from ajtrujillo/JobData.cs
TechJobsConsoleJobData FindbyValue
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
Last active March 12, 2017 00:25 — forked from ajtrujillo/JobData.cs
TechJobsConsoleJobData FindbyValue
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 / .bashrc
Last active September 21, 2017 14:35
bash - override cd to test for .nvmrc and instruct nvm to change node versions if present
# 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 / nvm-outdated.sh
Created December 11, 2017 16:47
check all outdated global packages in all versions of node.js installed by nvm
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 / global-npm-packages.md
Last active December 3, 2019 14:58
Global npm tools/packages that I use

Version control

  • git-run - A tool for managing multiple git repositories
  • 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.