Skip to content

Instantly share code, notes, and snippets.

View jamesplease's full-sized avatar
🍕
yum

James Please jamesplease

🍕
yum
  • USA
View GitHub Profile
const books = await fetchInitialBooks();
const booksReducer = resourceReducer('books', {
initialState: {
resources: books
}
});
calcEndPortfolio: function(form, i, j) {
var feesIncurred = this.roundTwoDecimals((this.sim[i][j].portfolio.start + this.sim[i][j].equities.growth + this.sim[i][j].bonds.growth + this.sim[i][j].cash.growth + this.sim[i][j].gold.growth) * (form.portfolio.percentFees / 100));
this.sim[i][j].portfolio.fees = feesIncurred;
var curValue = this.sim[i][j].equities.end + this.sim[i][j].bonds.end + this.sim[i][j].cash.end + this.sim[i][j].gold.end;
var curPercEquities = this.sim[i][j].equities.end / curValue;
var currPercCash = this.sim[i][j].cash.end / curValue;
var currPercBonds = this.sim[i][j].bonds.end / curValue;
var currPercGold = this.sim[i][j].gold.end / curValue;
@jamesplease
jamesplease / abortable-fetch-feature-detection.js
Last active December 7, 2017 19:21
Detect if a browser supports aborting fetch requests
// This will explode if the browser doesn't support `fetch`, so be sure to test for that first.
var canAbortFetch = 'signal' in Request.prototype;
export function updateGist(gistId, gist) {
const xhrOptions = {
url: `https://api.github.com/gists/${gistId}`,
json: true,
body: gist,
headers
};
const actionCreators = createActionCreators('create', {
resourceName: 'gists',
@jamesplease
jamesplease / file1.txt
Last active July 10, 2017 05:18
THSI IS NEW
String file contents
@jamesplease
jamesplease / file1.txt
Created July 10, 2017 01:51
some shit
String file contents
String file contents
@jamesplease
jamesplease / file1.txt
Last active July 9, 2017 22:06
Alright new gist description
updated pls ahere iasdasd
@jamesplease
jamesplease / file1.txt
Created July 9, 2017 20:35
the description for this gist
String file contents
@jamesplease
jamesplease / file1.txt
Created July 9, 2017 20:34
the description for this gist
String file contents