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 performanceMarks() { | |
| const marks: object[] = []; | |
| function mark(label: string) { | |
| marks.push({ label: label, timestamp: performance.now() }); | |
| } | |
| function getSummary() { | |
| if (marks.length < 2) { | |
| console.warn('You need at least two marks to generate a summary.'); |
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 makePalindromicNumber(number) { | |
| const regularNumber = number.toString(); | |
| const reversedNumber = number.toString().split("").reverse().join(""); | |
| return Number(`${regularNumber}${reversedNumber}`); | |
| } | |
| function generatePalindromicNumberList(digits = 2) { | |
| if (digits < 1) { | |
| throw new Error("'digits' should be equal or greater than '1'."); |
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
| ###################### | |
| ## Antigen Settings ## | |
| ###################### | |
| # Source Antigen | |
| source $HOME/antigen.zsh | |
| antigen use oh-my-zsh | |
| antigen bundle git |
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 path = require('path'); | |
| module.exports = ({config}) => { | |
| config.module.rules.push({ | |
| test: /\.scss$/, | |
| loaders: [ | |
| require.resolve('style-loader'), | |
| { | |
| loader: require.resolve('css-loader'), | |
| options: { |
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 defaultArr = [ | |
| { day: 1, from: undefined, to: undefined }, | |
| { day: 2, from: undefined, to: undefined }, | |
| { day: 3, from: undefined, to: undefined }, | |
| { day: 4, from: undefined, to: undefined }, | |
| { day: 5, from: undefined, to: undefined }, | |
| { day: 6, from: undefined, to: undefined }, | |
| { day: 7, from: undefined, to: undefined } | |
| ]; |
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
| class ImageResizer { | |
| constructor(minWidth, minHeight) { | |
| this.minWidth = minWidth; | |
| this.minHeight = minHeight; | |
| this.imageDimension = [1000, 500]; | |
| this.imageProportion = this.imageDimension[0] / this.imageDimension[1]; | |
| } | |
| resize() { |
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
| // Module Pattern | |
| // If not an IIFE, it's contents can be read as a string | |
| var Exposer = (function () { | |
| // Everything here is private | |
| var private = 'contents'; | |
| // Everything here is public | |
| return { | |
| public: function() { | |
| console.log(private); |
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
| // Closure 1 | |
| function sum( a ) { | |
| function inner( b ) { | |
| return a + b; | |
| } | |
| // Função inner é retornada e poderá | |
| // ser utilizada dessa forma estranha | |
| return inner; | |
| } | |
| var add5 = sum( 5 ); |
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
| { | |
| "name": "exercism-javascript", | |
| "version": "0.0.0", | |
| "description": "Exercism exercises in Javascript.", | |
| "author": "Katrina Owen", | |
| "private": true, | |
| "repository": { | |
| "type": "git", | |
| "url": "https://github.com/exercism/javascript" | |
| }, |
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
| ###################### | |
| ## Antigen Settings ## | |
| ###################### | |
| # Source Antigen | |
| source $HOME/antigen.zsh | |
| antigen use oh-my-zsh | |
| antigen bundle git |
NewerOlder