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 function debounceUntilTimeout(fun, delay, context = null) { | |
| var timer; | |
| return function delayedFunctionWrapper(...args) { | |
| clearTimeout(timer); | |
| args.unshift(context); | |
| timer = setTimeout(fun.bind.apply(fun, args), delay); | |
| }; | |
| } |
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 const Display = { | |
| None: { display: 'none' }, | |
| Block: { display: 'block' }, | |
| Inline: { display: 'inline' }, | |
| InlineBlock: { display: 'inline-block' }, | |
| NoneIf(cond) { | |
| return cond ? Display.None : null; | |
| }, | |
| BlockIf(cond) { | |
| return cond ? Display.Block : null; |
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
| // To make the most of native browser click event | |
| // Util.js | |
| export function isPlainLeftClick(event) { | |
| return !(event.button !== 0 || event.altKey || event.metaKey || event.ctrlKey || event.shiftKey); | |
| } | |
| // index.js | |
| import { isPlainLeftClick } from 'Util'; | |
| el.on('click', event => { |
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
| class Chat extends React.Component { | |
| constructor(props) { | |
| super(); | |
| this.state = { | |
| users: [], | |
| messages:[], | |
| text: '', | |
| status: 'userEnter' | |
| }; |
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'; | |
| class Chat extends React.Component { | |
| componentWillMount () { | |
| } | |
| render () { | |
| return ( | |
| <div> | |
| <Modal message={this.props.modal} /> |
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
| <ChatRoom> | |
| <Modal /> | |
| <LeftPane> | |
| <ChannelList /> | |
| <UserList /> | |
| </LeftPane> | |
| <RightPane> | |
| <Chat /> | |
| <ChatUserInput /> | |
| </RightPane> |
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
| \{% trans ([^\{%]+?) %\} | |
| {gettext($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
| try: | |
| errornous_block() | |
| except: | |
| import sys, traceback, pdb | |
| type, value, tb = sys.exc_info() | |
| traceback.print_exc() | |
| pdb.post_mortem(tb) | |
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
| git status -s | awk '{print $2}' | sed 's/\(.*\)/rsync -cav \1 [email protected]:~\/\1/' | sh |
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
| brew update | |
| brew install swig | |
| # M2Crypto is not being updated for a long time, and you will likely run into | |
| # problem like https://github.com/martinpaljak/M2Crypto/issues/60 | |
| # So just install patch provided by @mtrmac: https://github.com/martinpaljak/M2Crypto/pull/75 | |
| # This solved my problem on OSX 10.10 Yosemite. | |
| pip install git+git://github.com/mtrmac/M2Crypto.git@1f920615daafb5ae8dc8e11831459ebe986d3509 |