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 errorReportingMiddleware = store => next => action => { | |
| try { | |
| return next(action); | |
| } catch(err) { | |
| console.error('Caught an exception!', err); | |
| window.rg4js('send', { | |
| error: err, | |
| customData: { | |
| action, |
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 errorReportingMiddleware = store => next => action => { | |
| try { | |
| return next(action); | |
| } catch(err) { | |
| console.error('Caught an exception!', err); | |
| rg4js('send', { | |
| error: err, | |
| customData: { | |
| action, |
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 React from 'react'; | |
| // This has not been tested with a browser that doesn't support the window.performance api | |
| export default function LogRenderingTime(Component) { | |
| let boot = 0; | |
| class LogRenderTime extends React.Component { | |
| constructor(props) { | |
| super(props); | |
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 { withRouter } from 'react-router' | |
| class App extends Component { | |
| constructor(props) { | |
| super(props); | |
| this.props.history.listen((location, action) => { | |
| window.rg4js('trackEvent', { type: 'pageView', path: location.pathname }); | |
| }); |
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 INCOME_TAX(input) { | |
| var taxBrackets = { | |
| 14000: 0.105, | |
| 34000: 0.175, | |
| 22000: 0.30, | |
| 99999: 0.33 | |
| } | |
| var salary = parseInt(input, 10) | |
| return Object.keys(taxBrackets).reduce(function(acc, taxAmount) { |
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
| export default function StoryLayout(props) { | |
| return ( | |
| <div> | |
| <div className="row"> | |
| <div className="medium-8 columns"> | |
| <p><span style={{textDecoration: 'underline'}}>My stories</span> / {props.metadata.title}</p> | |
| <ViewSwitcher /> | |
| </div> | |
| </div> | |
| <div className="row"> |
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
| // ==UserScript== | |
| // @name Wanikani Override | |
| // @namespace wkoverride | |
| // @description Adds an "Ignore Answer" button during reviews that makes WaniKani ignore the current answer (useful if, for example, you made a stupid typo) | |
| // @include http://www.wanikani.com/review/session* | |
| // @include https://www.wanikani.com/review/session* | |
| // @version 1.1.3 | |
| // @author Rui Pinheiro | |
| // @grant GM_addStyle | |
| // @grant unsafeWindow |
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
| // ==UserScript== | |
| // @name WaniKani Improve | |
| // @namespace http://www.michaelfrank.com.br/wanikani_improve/ | |
| // @include https://www.wanikani.com/review/session | |
| // @include http://www.wanikani.com/review/session | |
| // @version 2.2.2 | |
| // @grant GM_addStyle | |
| // @grant GM_getResourceText | |
| // @run-at document-end | |
| // @require https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js |
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
| metrics.forEach(function(metric) { | |
| const extendedMetric = ExtendedMetric(metric) | |
| const metricDay = extendedMetric.day | |
| // TODO: Fix duplication | |
| extendedMetric.record.forEach((m) => { | |
| if(this.facets[m.id] == null) | |
| this.facets[m.id] = {[metricDay]: {}} | |
| this.facets[m.id][metricDay]['record'] = m |