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
async function fetchMegaportLocations() { | |
try { | |
const response = await fetch('https://api.megaport.com/v2/locations'); | |
if (!response.ok) { | |
throw new Error('Failed to fetch Megaport locations'); | |
} | |
const data = await response.json(); | |
return data; | |
} catch (error) { | |
return error; |
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
/** | |
* Get the value of the data at the specified path in the supplied object. | |
* | |
* @param {String} path - the object path e.g. 'address.office.state' | |
* @obj {Object} the object | |
*/ | |
function getValue(path, obj) { | |
const keys = path.split('.'); | |
let value = obj; |
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
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |
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
'.text.html.twig': | |
'Tag Print': | |
'prefix': '}}' | |
'body': '{{ $1 }$0' | |
'Tag Block': | |
'prefix': '%' | |
'body': '{% $1$2 %}$0{% end$1 %}' | |
'Tag Block (Block)': |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |