Skip to content

Instantly share code, notes, and snippets.

View jamesplease's full-sized avatar
😴
taking a nap

James Please jamesplease

😴
taking a nap
  • Netflix
  • USA
View GitHub Profile
@jamesplease
jamesplease / file1.txt
Created July 10, 2017 01:51
some shit
String file contents
@jamesplease
jamesplease / file1.txt
Last active July 10, 2017 05:18
THSI IS NEW
String file contents
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 / 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;
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;
const books = await fetchInitialBooks();
const booksReducer = resourceReducer('books', {
initialState: {
resources: books
}
});
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { readBook } from '../redux/books/action-creators';
class App extends Component {
render() {
const { isFetchingBook, book } = this.props;
return (
@jamesplease
jamesplease / 0.provider.jsx
Last active February 1, 2018 00:42
Hello
import ModalContext from './modal-context';
class Parent extends Component {
render() {
return (
<ModalContext.Provider value={this.state.modalContext}>
<Child/>
</ModalContext.Provider>
);
}
String file contents
@jamesplease
jamesplease / file1.txt
Created February 3, 2018 01:25
teatstt
String file contents