Skip to content

Instantly share code, notes, and snippets.

'use strict';
/** Base class for generic event handling.
* @example
*
* // Don’t forget to call `super()` if defining a constructor.
* class Foo extends Eventable {}
* let foo = new Foo();
*
* foo.on('bar', (data) => console.log(data));
@f-ricci
f-ricci / getWeeksInMonth.js
Created August 31, 2021 16:27 — forked from markthiessen/getWeeksInMonth.js
JavaScript - get weeks in a month as array of start and end days
//note: month is 0 based, just like Dates in js
function getWeeksInMonth(year, month) {
const weeks = [],
firstDate = new Date(year, month, 1),
lastDate = new Date(year, month + 1, 0),
numDays = lastDate.getDate();
let dayOfWeekCounter = firstDate.getDay();
for (let date = 1; date <= numDays; date++) {
@f-ricci
f-ricci / README.md
Created October 1, 2021 15:02 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store