Skip to content

Instantly share code, notes, and snippets.

View mikermcneil's full-sized avatar
🧑‍🚀

Mike McNeil mikermcneil

🧑‍🚀
View GitHub Profile
@mikermcneil
mikermcneil / is-sails-maintained.md
Last active June 20, 2024 16:57
Is Sails maintained?

Originally posted in sindresorhus/awesome-nodejs#998 (comment)

Just want to clear things up here: the Sails framework is actively maintained and widely used. For context, I am its creator and BDFL. @eashaw is lead maintainer and 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/108785018-37378000-753

@mikermcneil
mikermcneil / avatar.component.js
Last active June 8, 2020 18:24
Reference component (parasails / Vue)
/**
* <avatar>
* -----------------------------------------------------------------------------
*
* @type {Component}
*
* --- SLOTS: ---
* N/A
*
* --- EVENTS EMITTED: ---
@mikermcneil
mikermcneil / How to name a noun.md
Last active November 23, 2024 07:58
Naming conventions for things like variables, parameters, and attributes. (Naming nouns)

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 March 12, 2019 19:36
To allow emojis for one of your attributes when using Node.js / Sails / Waterline (MySQL)

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 February 9, 2019 15:37
An example of a component for using Stripe Elements with parasails / Vue.js (`<stripe-card-element>`)
/**
* <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 January 29, 2019 05:58
...as long as you properly handle things at the top level. (or otherwise just let https://npmjs.com/package/parley do it for you)
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 October 27, 2018 08:33
<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).
/**
* <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 October 24, 2018 17:59
In Fontawesome (at least Fontawesome 4.7.0), the icon for the red circle with a slash through it is called "fa-ban".

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

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

@mikermcneil
mikermcneil / datepicker.component.js
Created August 20, 2018 21:23
A datepicker component for Vue/parasails, assuming you're using the "Web App" template (aka parasails). _Note: this code was pasted here as of Mon Aug 20, 2018 -- note that this may have been updated or changed in the mean time._
// This goes in `assets/js/components/datepicker.component.js`
// ^^Remove this comment
/**
* <datepicker>
* -----------------------------------------------------------------------------
* A wrapper for the jQuery UI datepicker, which falls back to a date input on mobile.
*
* @type {Component}
*
* @event input [emitted when the value is changed privately]
@mikermcneil
mikermcneil / dom-fundamentals.md
Last active May 6, 2018 23:55
Dom Fundamentals Part 1: Display

Dom Fundamentals Part 1: Display

Repo:

https://github.com/mikermcneil/dom-fundamentals

Normal flow and display:inline

  • display:inline things work like text
  • <img> elements are technically display:inline by default. But that's dumb
  • To center a display:inline element, put text-align:center on the parent