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 fetch = require('node-fetch') | |
const fetchUserAvatar = async (userId) => { | |
const response = await fetch(`http://catappapi.herokuapp.com/users/${userId}`) | |
response // actual response, not the promise | |
const data = await response.json(); // without await, data will be a promise that resolves to the desired data | |
data | |
return data.imageUrl; |
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
public class Features { | |
// made it static so it can be called from main | |
private static int addOne(int value) { | |
return ++value; | |
} | |
public static void main(String[] args) { | |
// ==================== Functional interfaces and lambdas ==================== |
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 nl.abnamro.ignition.api.common.util; | |
import java.io.IOException; | |
import com.fasterxml.jackson.core.JsonProcessingException; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
/** | |
* JsonConverterUtil helps to convert object to JSON string | |
*/ |
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 nl.abnamro.ignition.api.common.util; | |
/** | |
* | |
* | |
* A wrapper for exceptions occuring while converting to JSON | |
* | |
* | |
*/ | |
public final class JsonConversionException extends RuntimeException { |
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
import java.util.Date; | |
import java.util.List; | |
import com.fasterxml.jackson.annotation.JsonInclude; | |
import lombok.Builder; | |
import lombok.Getter; | |
import nl.abnamro.ignition.api.common.domain.model.Violation; | |
@JsonInclude(JsonInclude.Include.NON_NULL) |
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
$ git remote rm origin | |
$ git remote add origin [email protected]:aplikacjainfo/proj1.git | |
$ git config master.remote origin | |
$ git config master.merge refs/heads/master |
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
<div class='page'> | |
<nav> | |
<a href='#'>Browse</a> | |
<a href='#'>Support</a> | |
<a href='#'>Blog</a> | |
<a href='#'>Sign in</a> | |
<a href='#'> | |
<div class='button'> | |
Sign up | |
</div> |
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
// STEP 1 - DEFINING TEMPLATE STRUCTURE AND STYLES | |
// creating the template | |
const template = document.createElement('template'); | |
// styles and HTML templating structure goes right here | |
template.innerHTML = ` | |
<style> | |
.wrapper { |
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
// STEP 1 - DEFINING TEMPLATE STRUCTURE AND STYLES | |
// creating the template | |
const template = document.createElement('template'); | |
// styles and HTML templating structure goes right here | |
template.innerHTML = ` | |
<style> | |
.wrapper { |
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
// STEP 2 - DEFININING COMPONENT BEHAVIOUR | |
class AwesomeComponent extends HTMLElement { | |
constructor() { | |
super(); | |
// enables to access the shadowDom through the shadowRoot | |
const shadow = this.attachShadow({ mode: 'open' }); | |
// we are going to attach the template to the shadowRoot ( || shadowDOM) | |
shadow.appendChild(template.content.cloneNode(true)); | |
} |
OlderNewer