Thor: Ragnarok The Killing of a Sacred Deer A Ghost Story Blame! Wonder Woman Get Out
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
class Rectangle { | |
constructor(height, width) { | |
this.height = height; | |
this.width = width; | |
} | |
get area() { | |
return this.height * this.width; | |
} | |
} |
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 transform = response => { | |
return Object.assign({}, response, { | |
verificationRequired: Boolean(response.verify), | |
amount: response.amount * 100 | |
}); | |
}; | |
const transform = response => { | |
return { | |
...response, |
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 transform = response => { | |
if (response.verify) { | |
response.verificationRequired = true; | |
} | |
response.amount = response.amount * 100; // I see this often for cents to dollars converion between APIs | |
return response; | |
}; |
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
import thirdPartyClient from 'some-third-party-client' | |
import myApi from '../../src/my-api' | |
describe('myApi', () => { | |
describe('Error handling', () => { | |
const myRejection = { | |
errorCode: 404, | |
errorMessage: 'You broke everything', | |
errorUrl: 'http://coolapp.api.docs/error/404/' | |
} |
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
import thirdPartyClient from 'some-third-party-client' | |
import myApi from '../../src/my-api' | |
describe('myApi', () => { | |
describe('Error handling', () => { | |
const myRejection = { | |
errorCode: 404, | |
errorMessage: 'You broke everything', | |
errorUrl: 'http://coolapp.api.docs/error/404/' | |
} |
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
function tmux — description Run\ tmux\ with\ support\ for\ italics | |
env TERM=myterm-it tmux -2 $argv | |
end |
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
set t_ZH=^[[3m | |
set t_ZR=^[[23m |
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
var serialize = function (obj) { | |
var str = []; | |
for (var prop in obj) { | |
if (obj.hasOwnProperty(prop)) { | |
str.push(encodeURIComponent(prop) + "=" + encodeURIComponent(obj[prop])); | |
} | |
} | |
return str.join("&"); |