Skip to content

Instantly share code, notes, and snippets.

View jsatk's full-sized avatar
💀

Jesse Atkinson jsatk

💀
View GitHub Profile
class Rectangle {
constructor(height, width) {
this.height = height;
this.width = width;
}
get area() {
return this.height * this.width;
}
}
const transform = response => {
return Object.assign({}, response, {
verificationRequired: Boolean(response.verify),
amount: response.amount * 100
});
};
const transform = response => {
return {
...response,
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;
};
@jsatk
jsatk / 2017-best-movies.md
Last active November 25, 2017 19:01
List of Best Movies of 2017

Best Movies of 2017

Movies I've Seen

Thor: Ragnarok The Killing of a Sacred Deer A Ghost Story Blame! Wonder Woman Get Out

@jsatk
jsatk / 2017-best-of-albums.md
Last active December 21, 2017 17:16
Favorite Albums of 2017

2017 — Best Albums Of

  1. Jason Isbell & the 400 Unit “Nashville Sound”
  2. Thundercat “Drunk”
  3. Fleet Foxes “Crack Up”
  4. Converge “The Dusk In Us”
  5. Gorillaz “Humanz”
  6. Kendrick Lamar “DAMN.”
  7. Ryan Adams “Prisoner”
  8. The War on Drugs “A Deeper Understanding”
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/'
}
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/'
}
function tmux — description Run\ tmux\ with\ support\ for\ italics
env TERM=myterm-it tmux -2 $argv
end
set t_ZH=^[[3m
set t_ZR=^[[23m
@jsatk
jsatk / serialize.js
Created December 15, 2014 23:56
URI Encode JS Object
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("&");