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
componentDidMount() { | |
this.createIsotopeContainer(); | |
// Only arrange if there are elements to arrange | |
if (_.get(this, 'props.children.length', 0) > 0) { | |
this.iso.arrange(); | |
} | |
} |
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
createIsotopeContainer() { | |
if (this.iso == null) { | |
this.iso = new Isotope(React.findDOMNode(this.refs.isotopeContainer), this.isoOptions); | |
} | |
} |
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
render() { | |
return <div className="isotope" ref="isotopeContainer"> | |
<div className="element-item-sizer"></div> | |
{this.props.children} | |
</div> | |
} |
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
componentDidUpdate(prevProps) { | |
// The list of keys seen in the previous render | |
let currentKeys = _.map(prevProps.children, (n) => n.key); | |
// The latest list of keys that have been rendered | |
let newKeys = _.map(this.props.children, (n) => n.key); | |
// Find which keys are new between the current set of keys and any new children passed to this component | |
let addKeys = _.difference(newKeys, currentKeys); |
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
filterElements(filter, e) { | |
FilterSortActions.filter(filter); | |
} | |
sortElements(sort, e) { | |
FilterSortActions.sort(sort); | |
} | |
renderLoadButtons() { | |
return _.map(loadData, d => <Button key={d.name} active={this.props.type == d.value} onClick={ElementActions.loadElements.bind(this, d.value)}>{d.name}</Button>, this) | |
} | |
renderFilterButtons() { |
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
#!/bin/bash | |
# ffmpeg installed via: brew install ffmpeg --enable-libx264 --enable-libfaac --enable-libass --with-faac --with-ass --with-tools | |
# ln -s /Applications/mkv2mp4.sh /usr/bin/mkv2mp4 | |
MKV=$1 | |
echo "MKV: $MKV" | |
MP4=`echo $MKV | sed 's/\.mkv/\.mp4/'` | |
echo "MP4: $MP4" | |
CMD="ffmpeg -y -i $MKV -vcodec copy -acodec libfaac -tune film $MP4" | |
echo "Executing: $CMD" |
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
interface IActionProductName { productName: string; } | |
interface IActionProductVersion { productVersion string; } | |
const requestUpdateProductVersion = createAction<interfaces.IActionProductName & interfaces.IActionProductVersion, void>(types.REQUEST_UPDATE_PRODUCT_VERSION, | |
(productName: string, productVersion: string) => ({productName, productVersion}), | |
null | |
); | |
const receiveUpdateProductVersion = createAction<interfaces.IActionProductName & interfaces.IActionProductVersion, interfaces.IMetaIsXhrError>(types.RECEIVE_UPDATE_PRODUCT_VERSION, | |
(productName: string, productVersion: string) => ({productName, productVersion}), | |
isXhrError |
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
interface IActionUpdateProductNameVersion { | |
productName: string; | |
productVersion: string; | |
} | |
const requestUpdateProductVersion = createAction<interfaces.IActionUpdateProductNameVersion, void>(types.REQUEST_UPDATE_PRODUCT_VERSION, | |
(productName: string, productVersion: string) => ({productName, productVersion}), | |
null | |
); | |
const receiveUpdateProductVersion = createAction<interfaces.IActionUpdateProductNameVersion, interfaces.IMetaIsXhrError>(types.RECEIVE_UPDATE_PRODUCT_VERSION, |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<system.webServer> | |
<defaultDocument> | |
<files> | |
<add value="index.html" /> | |
</files> | |
</defaultDocument> | |
<rewrite> | |
<rules> |
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
new EventHooksPlugin({ | |
'afterEmit': () => { | |
const hashedIndexHtml = glob.sync(`${paths.appBuild}/*.html`)[0]; | |
const hash = /index\.(.*?)\.html/.exec(hashedIndexHtml)[1]; | |
const webConfig = fs.readFileSync(`${paths.appBuild}/web.config`).toString(); | |
const result = webConfig.toString().replace(/index\.html/g, `index.${hash}.html`); | |
fs.writeFileSync(`${paths.appBuild}/web.config`, result); | |
} | |
}), |