This file has been truncated, but you can view the full file.
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
{"GKA":{"name":"Goroka","city":"Goroka","country":"Papua New Guinea","iata":"GKA","icao":"AYGA","latitude":"-6.081689","longitude":"145.391881","altitude":"5282","timezone":"10","dst":"U"},"MAG":{"name":"Madang","city":"Madang","country":"Papua New Guinea","iata":"MAG","icao":"AYMD","latitude":"-5.207083","longitude":"145.7887","altitude":"20","timezone":"10","dst":"U"},"HGU":{"name":"Mount Hagen","city":"Mount Hagen","country":"Papua New Guinea","iata":"HGU","icao":"AYMH","latitude":"-5.826789","longitude":"144.295861","altitude":"5388","timezone":"10","dst":"U"},"LAE":{"name":"Nadzab","city":"Nadzab","country":"Papua New Guinea","iata":"LAE","icao":"AYNZ","latitude":"-6.569828","longitude":"146.726242","altitude":"239","timezone":"10","dst":"U"},"POM":{"name":"Port Moresby Jacksons Intl","city":"Port Moresby","country":"Papua New Guinea","iata":"POM","icao":"AYPY","latitude":"-9.443383","longitude":"147.22005","altitude":"146","timezone":"10","dst":"U"},"WWK":{"name":"Wewak Intl","city":"Wewak","country":"P |
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
// Example starter JavaScript for disabling form submissions if there are invalid fields | |
(function () { | |
'use strict'; | |
window.addEventListener('load', function () { | |
// Fetch all the forms we want to apply custom Bootstrap validation styles to | |
var forms = document.getElementsByClassName('needs-validation'); | |
// Loop over them and prevent submission | |
var validation = Array.prototype.filter.call(forms, function (form) { | |
form.addEventListener('submit', function (event) { | |
event.preventDefault(); |
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
[ | |
{ | |
"label": "(GMT-10:00) Hawaii Time", | |
"value": "GMT-10:00" | |
}, | |
{ | |
"label": "(GMT-09:00) Alaska Time", | |
"value": "GMT-09:00" | |
}, | |
{ |
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 telephoneCheck(phoneNumber = "") { | |
const hasValidLength = isValidTelephoneLength(phoneNumber); | |
let copyPhoneNumber = phoneNumber; | |
if (!hasValidLength) return false; | |
if (hasCountryCode(copyPhoneNumber)) { | |
if (!hasValidCountryCode(copyPhoneNumber)) return false; | |
copyPhoneNumber = cleanWhitespaceAtStart( |
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
{ | |
"version": 2, | |
"name": "nestjs-now", | |
"builds": [ | |
{ | |
"src": "dist/main.js", | |
"use": "@now/node" | |
} | |
], | |
"routes": [ |
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: Node CI | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: |
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
export const App = () => { | |
const [todos, setTodos] = useState([]); | |
useEffect(() => { | |
const getTodos = async () => { | |
const { data } = await axios.get('https://jsonplaceholder.typicode.com/todos/'); | |
setTodos(data); | |
}; | |
getTodos(); | |
}, []); | |
return ( |
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 { todoResponseToTodoListTransformer } from './todoResponseToTodoList'; | |
export const App = () => { | |
const [todos, setTodos] = useState([]); | |
useEffect(() => { | |
const getTodos = async () => { | |
const { data } = await axios.get('https://jsonplaceholder.typicode.com/todos/'); | |
const transformedTodos = data.map(todoResponseToTodoListTransformer); // ✅ | |
setTodos(transformedTodos); |
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
{ | |
"firstName": { | |
"type": "string" | |
}, | |
"lastName": { | |
"type": "string" | |
}, | |
"avatarURL": { | |
"type": "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
// .... | |
const handleSubmit = async (formValues) => { | |
const response = await fetch('https://myserver.com/api/user', { | |
method: 'POST', | |
body: JSON.stringify(formValues), | |
}); | |
// ... | |
}; |
OlderNewer