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
Options -Indexes | |
<IfModule !mod_rewrite.c> | |
Deny from all | |
</IfModule> | |
<IfModule mod_rewrite.c> |
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
#!/bin/sh | |
confirm () { | |
read -r -p "${1:-Are you sure? [y/N]} " response | |
case $response in | |
[yY][eE][sS]|[yY]) | |
# true | |
echo 1; | |
;; | |
*) |
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
|
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"; | |
import ReactDOM from "react-dom"; | |
import { AppContainer } from "react-hot-loader"; | |
import App from "./App"; | |
const render = (hydrate = false) => { | |
const container = document.querySelector("#app"); | |
const element = ( | |
<AppContainer> |
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"; | |
import PropTypes from "prop-types"; | |
import { createPortal } from "react-dom"; | |
class Portal extends React.Component { | |
static propTypes = { | |
children: PropTypes.node, | |
}; | |
state = { mounted: false }; |
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
// Helper function: Loop through all components in the renderProps object // and returns a new object with the desired key | |
let getPropsFromRoute = (renderProps, componentProps) => { | |
let props = {}; | |
let lastRoute = renderProps.routes[-1]; | |
renderProps.routes.reduceRight((prevRoute, currRoute) => { | |
componentProps.forEach(componentProp => { | |
if (!props[componentProp] && currRoute.component[componentProp]) { | |
props[componentProp] = currRoute.component[componentProp]; | |
} | |
}); |
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'; | |
import { render } from 'react-dom'; | |
import { Provider } from 'react-redux'; | |
import { Router, browserHistory, useRouterHistory } from 'react-router'; | |
import { syncHistoryWithStore } from 'react-router-redux'; | |
import { configureStore } from './app/SpreeReactStore'; | |
import routes from './app/routes'; | |
let state = window.__initialState__ || undefined; |
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
|
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
// inherits from promise class through the chain | |
new ExtendablePromise(resolve => resolve()).then() instanceof Promise === true | |
// inherits from promise subclass through the chain | |
new ExtendablePromise(resolve => resolve()).then() instanceof ExtendablePromise === true | |
// allows for direct calls for ES5 inheritance | |
ExtendablePromise.call(Object.create(ExtendablePromise.prototype), resolve => resolve()).then() |
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
|
OlderNewer