.nvmrcorpackage.jsonengines: How to Lock down Your Project’s Node Version Using .nvmrc or engines- Nock can be used to test modules that perform HTTP requests in isolation.
- Project Guidelines: a list of guidelines we've found, written and gathered that (we think) works really well with most JavaScript projects.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class SleepImmersion | |
| { | |
| protected $sheeps = 0; | |
| protected $timestamp = 0; | |
| protected $userStatus = FALSE; | |
| public function __construct(){ | |
| $this->timestamp = time(); | |
| $this->isUserAsleep(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class Tools{ | |
| /** | |
| * URL safe string encryption method | |
| * | |
| * @param string $string | |
| * @param string $key | |
| * @return string Returns an url safe encrypted string | |
| * @throws \InvalidArgumentException | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private setExpiresAt() { | |
| const endDate = this.event.endDate * 1000; | |
| const now = Date.now(); | |
| const expirationLimit = 72; // time in hours | |
| // Event already expired | |
| this.expiresAt = this.translate.instant('expired_event'); | |
| console.log(now - endDate); | |
| if (now - endDate <= 47 * 3600 * 1000) { | |
| // If the event ended {{expirationLimit}} or less ago | |
| const expDays = (expirationLimit / 24) - Math.ceil((now - endDate) / (24 * 3600000)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Based on source: https://twitter.com/_developit/status/1369397356098097154/photo/1 | |
| // links listener | |
| addEventListener('click', e => { | |
| let a = e.target; | |
| // Loop avoids having to jump to `http://event.target.parentNode` | |
| // when the target is a Text or other non-Element node. | |
| // It's also a bit faster than closest() and supports IE11. | |
| while (a.localName !== 'a' && (a = a.parentNode)); | |
| if (a && a.origin == location.origin && !a.target) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Numeric base transformations in JavaScript |
- How to Scale Frontend with Micro Frontends Architecture
- Lessons from DAZN: Scaling Your Project with Micro-Frontends
- Micro Frontend Architecture: The Newest Approach To Building Scalable Frontend
- Micro-Frontends Course - Beginner to Expert 📺
- 8 Consejos para el uso de Micro frontend (feat. Ruben Casas) 📺
- TechTallk: ¿Qué son los Micro Frontends? 📺
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const words = [ | |
| [ | |
| 'bird', | |
| 'clock', | |
| 'boy', | |
| 'plastic', | |
| 'duck', | |
| 'teacher', | |
| 'old lady', | |
| 'professor', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function downloadFile(content: BlobPart, mimeType: string, filename: string) { | |
| const a = document.createElement('a'); // Create "a" element | |
| const blob = new Blob([content], { type: mimeType }); // Create a blob (file-like object) | |
| const url = URL.createObjectURL(blob); // Create an object URL from blob | |
| a.setAttribute('href', url); // Set "a" element link | |
| a.setAttribute('download', filename); // Set download filename | |
| a.click(); // Start downloading | |
| } |
OlderNewer