Using Moment.js make an Array of Arrays, where the first element is the 1st week in the month, and the first element in the inner array Sunday
October 2019
Su Mo Tu We Th Fr Sa
01 02 03 04 05
06 07 08 09 10 11 12
13 14 15 16 17 18 19
| /* This really isnt needed anymore, Chrome can copy a CSS, just like an Xpath or Selector, by right clicking on the element. | |
| * | |
| * | |
| * getStyleObject Plugin for jQuery JavaScript Library | |
| * From: http://upshots.org/?p=112 | |
| */ | |
| (function($){ | |
| $.fn.getStyleObject = function(){ | |
| var dom = this.get(0); |
| /** | |
| BIDI map from an object | |
| **/ | |
| const values = { | |
| ACTIVE: 1, | |
| INACTIVE: 2 | |
| } | |
| let statusEnum = |
| ## AVAHI is a whay of ZeroConf and the host name will be discovered by the clients in the network | |
| sudo apt-get install avahi-daemon avahi-discover avahi-utils libnss-mdns mdns-scan |
Because sometimes your modules need to be more flexible than a yoga instructor! 🧘♂️
Ever found yourself in "require hell" where your Node.js modules are so tightly coupled they might as well be married? Or maybe you've tried to test a function that depends on 17 different external services and your test file looks like a spaghetti monster?
This GIST provides two battle-tested patterns for implementing Dependency Injection with the Factory Pattern in Node.js. No fancy frameworks required - just good ol' JavaScript closures doing what they do best!
| /** | |
| * Dynamic Proxy | |
| * | |
| * Wrapping an object with a proxy, and references the previous values. | |
| * Services is an Object with mixed values, of which is a function ( or even functions ). | |
| */ | |
| const Services = { | |
| firstname: 'Anita', | |
| surname: 'Bath', | |
| gender: 'female', |
| 'use strict'; | |
| var isBlank = function isBlank(value) { | |
| return (value || '').toString().trim().split('').length === 0; | |
| }; |
| var toBoolean = function toBoolean ( val ) { | |
| var returnValue = false; | |
| if ( val ) { | |
| returnValue = val.toString().toLowerCase() === 'true'; | |
| } | |
| return returnValue; | |
| }; |