This file contains 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, { Component, PropTypes } from 'react'; | |
import { Footer, Header } from 'components/index'; | |
import styles from './FAQPage.scss'; | |
function highlightWord(root, word) { | |
/* eslint-disable no-shadow, no-cond-assign */ | |
function textNodesUnder(root) { | |
const walk = document.createTreeWalker(root, NodeFilter.SHOW_TEXT, null, false); |
This file contains 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
/* eslint-disable no-console */ | |
import React, { PropTypes, Component } from 'react'; | |
import getClassName from '../../utils/getClassName'; | |
const bem = getClassName('TriggerPushNotification'); | |
export default class TriggerPushNotification extends Component { | |
static get propTypes() { | |
return { |
This file contains 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 '~constants'; | |
.stamp-Video { | |
position: relative; | |
background-color: @blackColor; | |
cursor: pointer; | |
} | |
.stamp-Video-box { | |
color: @lightColor; |
This file contains 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 delay({ dispatch, getState }) { | |
const delayed = {}; | |
return (next) => { | |
return (action) => { | |
const actionIndex = (delayed[action.type] || []).indexOf(action.delay); | |
if (delayed[action.type] && actionIndex > -1) { | |
const delayedActionCreator = delayed[action.type][actionIndex]; |
This file contains 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() { | |
// Do not use this library. This is just a fun example to prove a | |
// point. | |
var Bloop = window.Bloop = {}; | |
var mountId = 0; | |
function newMountId() { | |
return mountId++; | |
} |
This file contains 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
/* @flow */ | |
type State = Object | |
type Action = {type: string | void} | |
type AsyncAction = (performAction: FluxPerformFunction, state: State) => void | |
type ActionCreator = () => Action | AsyncAction | |
type StoreFunction = (state: State, action: Action) => State |
This file contains 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
/* NINJA FP */ | |
function mapping(transform) { | |
return function (reduce) { | |
return function (result, input) { | |
return reduce(result, transform(input)); | |
}; | |
}; | |
} |
This file contains 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
/** | |
* Stores are just seed + reduce function. | |
* Notice they are plain objects and don't own the state. | |
*/ | |
const countUpStore = { | |
seed: { | |
counter: 0 | |
}, | |
reduce(state, action) { |
This file contains 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 serialize(root) { | |
if (root == null) | |
return "- "; | |
else { | |
return root.value + " " + serialize(root.node.left) + serialize(root.node.right); | |
} | |
} | |
function deserialize(string) { | |
var tokens = string.trim().split(' '); |
This file contains 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 sort(arr) { | |
var tmp = []; | |
var sorted = []; | |
var i, l; | |
var ii, ll; | |
for (i=0, l=arr.length; i<l; i++) { | |
var value = arr[i]; | |
if (!tmp[value]) { |