Fetch Syntax


await fetch("/gateway/api/permissions/permitted", {
    method: 'POST',
    credentials: 'same-origin',
    headers: {
        'Content-Type': 'application/json',
    },
    body: JSON.stringify({
        permissionId: 'foo',
        resourceId: 'bar/1234'
    })
}).then(res => res.json()).then(data => console.log(data.permitted));

await fetch("/rest/api/2/user?username=admin", {
    credentials: 'include'
}).then(res => res.json());
        

Kill all processes on an offending port


// List all processes currently using the specified port (in this case 8080)
lsof -i tcp:8080
    
// This will return a response that looks like this
COMMAND   PID     USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
node    31588 username  13u   IPv6  0x1a234bcd5678ee9      0t0  TCP *:http-alt (LISTEN)
    
// You can then stop the offending process with this command using the listed PID
kill -15 31588
        

Local Storage


localStorage.setItem(
    "key",
    JSON.stringify({
        value1: true,
        value2: false
    })
);
        

Example basic SQL query


SELECT count(event)
FROM my_zone.my_events
WHERE event = 'awesome.analytics.event.name'
    AND DAY >= '2018-03-28'
    AND product = 'jira'