Skip to content

Instantly share code, notes, and snippets.

View mbektimirov's full-sized avatar
🦀

Marat Bektimirov mbektimirov

🦀
View GitHub Profile
@mbektimirov
mbektimirov / state-from-props.coffee
Created October 14, 2014 08:16
React: state from props
module.exports = React.createClass
displayName: 'Switcher'
getInitialState: (props) ->
props ||= @props
checked: props.checked
componentWillReceiveProps: (newProps, oldProps) ->
@setState @getInitialState(newProps)
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
}
function createFakeQueries(count, minTime, maxTime) {
return Array(count)
.fill()
.map((_, i) => {
const time = getRandomInt(minTime, maxTime);
const queryCaller = () =>
# Set CLICOLOR if you want Ansi Colors in iTerm2
export CLICOLOR=1
#
# # Set colors to match iTerm2 Terminal Colors
export TERM=xterm-256color
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh