This file contains 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": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Example", | |
"type": "node", | |
"request": "launch", | |
"runtimeExecutable": "node", | |
"runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"], |
This file contains 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 axios from 'axios'; | |
class Service { | |
constructor() { | |
let service = axios.create({ | |
headers: {csrf: 'token'} | |
}); | |
service.interceptors.response.use(this.handleSuccess, this.handleError); | |
this.service = service; | |
} |
This file contains 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
[ | |
{ | |
"id": 1, | |
"name": "Adana", | |
"latitude": "37.0000", | |
"longitude": "35.3213", | |
"population": 2183167, | |
"region": "Akdeniz" | |
}, | |
{ |
This file contains 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
// Takes a credit card string value and returns true on valid number | |
function valid_credit_card(value) { | |
// Accept only digits, dashes or spaces | |
if (/[^0-9-\s]+/.test(value)) return false; | |
// The Luhn Algorithm. It's so pretty. | |
let nCheck = 0, bEven = false; | |
value = value.replace(/\D/g, ""); | |
for (var n = value.length - 1; n >= 0; n--) { |