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
package collections; | |
import java.util.LinkedHashMap; | |
public class StringRunner { | |
public static void main(String[] args) { | |
String str = "This is a great thing"; | |
String[] arr = str.toLowerCase().replaceAll("\\s", "").split(""); | |
LinkedHashMap<String, Integer> arrayMap = new LinkedHashMap<>(); |
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 string = 'hello'; | |
for(let char of string){ | |
console.log(char.toUpperCase().repeat(5)); | |
} | |
//HHHHH | |
//EEEEE | |
//LLLLL | |
//LLLLL | |
//OOOOO |
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 person = { | |
name: 'Alex', | |
age: 25, | |
sayHi: function(){ | |
console.log(`Hi there, my name is ${this.name} and I am ${this.age} years old`) | |
} | |
} | |
for (let key in person){ | |
console.log(`${key} => ${person[key]}`) |
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 numbers = [1,2,3,4,5]; | |
for(let i = 0; i < 10; i ++){ | |
console.log(numbers[i]); | |
} |
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 |
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
yarn add prettier eslint-config-prettier eslint-plugin-prettier husky lint-staged pretty-quick --dev |
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 votes = [ | |
'tacos', | |
'pizza', | |
'pizza', | |
'tacos', | |
'fries', | |
'ice cream', | |
'ice cream', | |
'pizza' | |
] |
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
{ | |
"extends": ["react-app", "plugin:prettier/recommended"] | |
} | |
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
/* | |
We can break React's life cycle methods into two categories | |
1. When a component gets mounted to the DOM and unmounted | |
2. When a component receives new data | |
When a component is initialized and added to the DOM (mounting) and when the component is removed from the DOM(unmounting). | |
These methods will be invoked only once during the life of the component | |
*/ | |
//Some tasks that are important to do when a component mounts or unmounts | |
// - Establish some default props in our component |
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
//Stateless components | |
import React, {Components} from 'react'; | |
class Repos extends Component { | |
render(){ | |
return ( | |
<div> | |
<h3> User Repos </h3> | |
<ul className="list-group"> | |
{this.props.repos.map((repo, index) => { |
NewerOlder