Skip to content

Instantly share code, notes, and snippets.

View chittolina's full-sized avatar
🚀

Gabriel Chittolina chittolina

🚀
  • Harbour
  • Florianópolis, SC, Brazil
View GitHub Profile
@jrhames
jrhames / moment-holidays.js
Last active January 19, 2023 03:12
Holidays plugin for Moment.JS
//## Moment.JS Holiday Plugin
//
//Usage:
// Call .holiday() from any moment object. If date is a US Federal Holiday, name of the holiday will be returned.
// Otherwise, return nothing.
//
// Example:
// `moment('12/25/2013').holiday()` will return "Christmas Day"
//
//Holidays:
@branneman
branneman / better-nodejs-require-paths.md
Last active June 29, 2024 16:00
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@nicooprat
nicooprat / keyframes-mixin.less
Last active March 9, 2021 07:58
A simple and elegant keyframes mixin for LESS
// --------------
// Needs LESS compiler >= 1.7.0
// Docs : http://lesscss.org/features/#detached-rulesets-feature
// --------------
// 1. Define the mixin for cross browser keyframes
.keyframes(@name,@rules) {
@-webkit-keyframes @name {