Skip to content

Instantly share code, notes, and snippets.

View soniktrooth's full-sized avatar
🤘
Thrashing

Josh soniktrooth

🤘
Thrashing
View GitHub Profile
@soniktrooth
soniktrooth / megaportActivity3.js
Last active April 26, 2024 04:57
Fetch a list of Megaport locations
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;
@soniktrooth
soniktrooth / megaportActivity2.js
Last active April 29, 2024 00:26
Megaport 
Activity 2
/**
* 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;
# 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 ->
@soniktrooth
soniktrooth / Twig Snippets for Atom
Last active November 10, 2016 00:06 — forked from rossluebe/Twig Snippets for Atom
Twig Snippets for Atom
'.text.html.twig':
'Tag Print':
'prefix': '}}'
'body': '{{ $1 }$0'
'Tag Block':
'prefix': '%'
'body': '{% $1$2 %}$0{% end$1 %}'
'Tag Block (Block)':
@soniktrooth
soniktrooth / 0_reuse_code.js
Last active August 29, 2015 14:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console