Skip to content

Instantly share code, notes, and snippets.

Avatar
🧑‍🚀

Mike McNeil mikermcneil

🧑‍🚀
View GitHub Profile
@mikermcneil
mikermcneil / monitor-a-sails-app-in-papertrail.md
Created Jul 7, 2021
Here's how to monitor your Sails app for missing `await`s, 500 errors, failed script runs, and more
View monitor-a-sails-app-in-papertrail.md

Monitoring your Sails app for errors

Monitor your Sails app for missing awaits, 500 errors, failed script runs, and more!

Here's how to monitor a Sails app for errors using Papertrail, a logging tool that works with anything but is particularly easy to use as a Heroku add-on. This search string uses Papertrail's search syntax, but the log output it's searching for is not Heroku-specific; neither is it Papertrail-specific. (Search "sails.js platzi" for a tutorial with an example involving Heroku. See part 5.) Anyway, you can use the general principles here to monitor a Sails app using any logging tool.

(error: Sending 500 ("Server Error") response:) OR (error: Background instruction failed:) OR (WARNING: A function that was initially called over 15 seconds) OR (Error: Internal error occurred while running) OR (Could not deliver reminders to recipients of invitation) OR (Could not run script)
@mikermcneil
mikermcneil / finding-the-fault-lines.md
Last active May 9, 2021
Finding the fault lines - Longitudinal vs latitudinal work division
View finding-the-fault-lines.md

Finding the fault lines

May 8, 2021

In our agile world, we often divide up tasks longitudinally; that is, along goal-oriented lines. This results in mini-projects like “put documentation on the website” or “put a contact form on the website”.

This is an intuitive and low-effort management exercise, which can have great results. And I love how it lets you put trust in people to figure things out. The problem is, to assign a directly responsible individual (DRI), they have to be the right person to make decisions about every part of the project: from the marketing copy to the coding to the deployment of the changes. If they don't? Not only can it be very frustrating for them, but output and quality of work can suffer. Not to mention that getting things back on track can eat up valuable time for other members of the team.

Alternatively, you can divide tasks latitudinally - along their natural, functional lines. These lines have to be felt out, since they depend on the nature of the types of work in

View is-sails-maintained.md

Originally posted in https://github.com/sindresorhus/awesome-nodejs/pull/998#issuecomment-783765484

Just want to clear things up here: the Sails framework is actively maintained and widely used. For context, I am its creator and BDFL. @rachaelshaw is lead maintainer, and @eashaw is community manager. @DominusKelvin also maintains an active supplementary community called SailsCasts. https://sailsjs.com/support has a full list of resources you might want to check out. As far as what that means: there's a daily check for vulnerable code paths, a weekly roundup of community GitHub issues/PRs, and active development as needed to fix any priority bugs. This is all funded by Flagship customers and supplemented by my continued personal financial commitment to keep the Sails framework alive.

This will continue for many years to come.

image ![image](https://user-images.githubusercontent.com/618009/10878

@mikermcneil
mikermcneil / avatar.component.js
Last active Jun 8, 2020
Reference component (parasails / Vue)
View avatar.component.js
/**
* <avatar>
* -----------------------------------------------------------------------------
*
* @type {Component}
*
* --- SLOTS: ---
* N/A
*
* --- EVENTS EMITTED: ---
@mikermcneil
mikermcneil / How to name a noun.md
Last active Jul 16, 2021
Naming conventions for things like variables, parameters, and attributes.
View How to name a noun.md

How to name a noun

Some of the naming conventions we use at Sails for nouns like variables, parameters, property names, config settings, database attributes/columns/fields, and so on.

Why bother?

Naming is hard. And naming conventions usually end up being wrong, or incomplete at best.

This may be an unpopular opinion, but in my experience, coming up with new methodologies for variables and such doesn't usually create a lot of value for an individual developer. So why bother?

@mikermcneil
mikermcneil / allow-emojis-mysql-with-nodejs-using-sailsjs-and-waterline.md
Created Mar 12, 2019
To allow emojis for one of your attributes when using Node.js / Sails / Waterline (MySQL)
View allow-emojis-mysql-with-nodejs-using-sailsjs-and-waterline.md

To allow emojis for one of your attributes when using Node.js / Sails / Waterline

Use the following auto-migration directive for MySQL:

columnType: 'LONGTEXT CHARACTER SET utf8mb4',// « allow emojis
@mikermcneil
mikermcneil / stripe-card-element.component.js
Created Feb 9, 2019
An example of a component for using Stripe Elements with parasails / Vue.js (`<stripe-card-element>`)
View stripe-card-element.component.js
/**
* <stripe-card-element>
* -----------------------------------------------------------------------------
* A wrapper for the Stripe Elements "card" component (https://stripe.com/elements)
*
* Example usage:
* ```
* <stripe-card-element stripePublishableKey="…" v-model="formData.cardInfo"></stripe-card-element>
* ```
*
@mikermcneil
mikermcneil / you-dont-have-to-worry-about-uncaught-rejections.js
Created Jan 29, 2019
...as long as you properly handle things at the top level. (or otherwise just let https://npmjs.com/package/parley do it for you)
View you-dont-have-to-worry-about-uncaught-rejections.js
async function hoHum() {
return 'ho hum';
}
async function hiHo() {
return 'hi ho!';
}
async function hoNo() {
throw new Error('ho... no!');
@mikermcneil
mikermcneil / js-timestamp.component.js
Created Oct 27, 2018
<js-timestamp>: A Parasails/Vue.js component for live-updating timestamps built on moment.js (relies on `moment` already being available to your frontend code-- eg. by putting it in assets/dependencies/moment.js).
View js-timestamp.component.js
/**
* <js-timestamp>
* (assets/js/components/js-timestamp.component.js)
* -----------------------------------------------------------------------------
* A human-readable, self-updating "timeago" timestamp, with some special rules:
*
* • Within 24 hours, displays in "timeago" format.
* • Within a month, displays month, day, and time of day.
* • Within a year, displays just the month and day.
* • Older/newer than that, displays the month and day with the full year.
@mikermcneil
mikermcneil / fa-ban.md
Last active Oct 24, 2018
In Fontawesome (at least Fontawesome 4.7.0), the icon for the red circle with a slash through it is called "fa-ban".
View fa-ban.md

In Fontawesome, the icon for the red circle with a slash through it is called "fa-ban"

Like a "no smoking" sign, but just the circle part

fontawesome 4.7.0: https://fontawesome.com/v4.7.0/cheatsheet/

Making this gist because I forget how to find it literally every time I want to use it