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
exports.url = '/users.list'; | |
exports.method = 'get'; | |
exports.validateInput = false; | |
const mockListConversations = jest | |
.fn() | |
.mockImplementationOnce(() => ({ | |
ok: true, | |
channels: [ | |
{ |
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
exports.url = '/conversations.list'; | |
exports.method = 'get'; | |
exports.validateInput = false; | |
exports.additionalMocks = [ | |
{ | |
method: 'get', | |
url: '/users.list', | |
response: { | |
ok: true, | |
members: [ |
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 { | |
copyAllProjectCustomFields, | |
} = require('./copy_all_project_custom_fields'); | |
const { falafel } = require('./mocks'); | |
const input = { | |
access_token: 1234, | |
destination_project_id: 2, | |
source_project_id: 1, |
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
async input => { | |
const { access_token, destination_project_id, source_project_id } = input; | |
let copiedFieldCount = 0; | |
// Get the source project | |
const sourceProject = await falafel.asana.getProject({ | |
access_token, | |
project_id: source_project_id, | |
}); |
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
async function (input) { | |
console.log(`INSIDE #generic_request: ${JSON.stringify(input)}`); | |
const { client_id, client_secret, code, refresh_token } = input.body; | |
console.log( | |
`PARAMS FOR getAccessToken: ${JSON.stringify({ | |
client_id, | |
client_secret, |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<!-- Required meta tags --> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<title>Life</title> | |
<style type="text/css"> |
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
<textarea id="code">return "hi";</textarea> | |
<button id="button">Run</button> | |
<pre id="output"></pre> | |
<script> | |
let button = document.getElementById('button'); | |
let code = document.getElementById('code'); | |
let output = document.getElementById('output'); | |
button.addEventListener('click', () => { | |
let result; |
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
let aboutURL = 'https://eloquentjavascript.net/author'; | |
let mediaTypes = [ | |
'text/plain', | |
'text/html', | |
'application/json', | |
'application/rainbow+unicorns' | |
]; | |
async function getResponsesForMediaType(url, type) { | |
let r = await fetch(url, {headers: {'accept': type}}); |
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
<canvas width="400" height="400"></canvas> | |
<script> | |
const roundDown = num => { | |
return Math.floor(num); | |
}; | |
const roundUp = num => { | |
return Math.floor(num + 0.5); | |
}; | |
let cx = document.querySelector("canvas").getContext("2d"); |
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
<canvas width="600" height="300"></canvas> | |
<script> | |
let cx = document.querySelector("canvas").getContext("2d"); | |
let total = results | |
.reduce((sum, {count}) => sum + count, 0); | |
let currentAngle = -0.5 * Math.PI; | |
let centerX = 300, centerY = 150, radius = 100; | |
cx.font = "16px Helvetica"; | |
cx.fillStyle = "black"; |
NewerOlder