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 class LoginContainer extends Component { | |
getInitState () { | |
return { username: '', password: ''}; | |
} | |
onSubmit (event) { | |
event.preventDefault(); | |
const {username, password} = this.state; | |
request | |
.post('/admin/login') | |
.send({username, password}) |
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
class LoginForm extends Component { | |
render() { | |
const { fields: { username, password }, handleSubmit } = this.props; | |
return ( | |
<form className="form-horizontal" onSubmit={ handleSubmit(this.props.memberLogin) }> | |
<div className="form-group"> | |
<input type="text" placeholder="Username" className="form-control" {...username} /> | |
</div> | |
<div className="form-group"> | |
<input type="password" placeholder="Password" className="form-control" {...password} /> |
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
'use strict'; | |
var _sharePostStatus; | |
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | |
var PUBLICIZE_SHARE = 'PUBLICIZE_SHARE'; | |
var PUBLICIZE_SHARE_SUCCESS = 'PUBLICIZE_SHARE_SUCCESS'; | |
var PUBLICIZE_SHARE_FAILURE = 'PUBLICIZE_SHARE_FAILURE'; | |
var PUBLICIZE_SHARE_DISMISS = 'PUBLICIZE_SHARE_DISMISS'; |
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
'use strict'; | |
var _sharePostStatus; | |
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | |
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | |
var PUBLICIZE_SHARE = 'PUBLICIZE_SHARE'; | |
var PUBLICIZE_SHARE_SUCCESS = 'PUBLICIZE_SHARE_SUCCESS'; |
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
const PUBLICIZE_SHARE = 'PUBLICIZE_SHARE'; | |
const PUBLICIZE_SHARE_SUCCESS = 'PUBLICIZE_SHARE_SUCCESS'; | |
const PUBLICIZE_SHARE_FAILURE = 'PUBLICIZE_SHARE_FAILURE'; | |
const PUBLICIZE_SHARE_DISMISS = 'PUBLICIZE_SHARE_DISMISS'; | |
function update(state, action, post_status){ | |
var next_state = Object.assign({}, state); | |
var post = {}; | |
post[action.postId] = post_status; | |
next_state[action.siteId] = Object.assign({}, next_state[action.siteId], post); |
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
const PUBLICIZE_SHARE = 'PUBLICIZE_SHARE'; | |
const PUBLICIZE_SHARE_SUCCESS = 'PUBLICIZE_SHARE_SUCCESS'; | |
const PUBLICIZE_SHARE_FAILURE = 'PUBLICIZE_SHARE_FAILURE'; | |
const PUBLICIZE_SHARE_DISMISS = 'PUBLICIZE_SHARE_DISMISS'; | |
const sharePostStatus = { | |
[ PUBLICIZE_SHARE ]: ( state, { siteId, postId } ) => | |
( { ...state, [ siteId ]: { ...state[ siteId ], [ postId ]: { | |
requesting: true, | |
} } } ), |
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 addTodo(state, action){ | |
var new_state; | |
if(action.type !== "ADD_TODO") | |
return state; | |
if(!state) | |
new_state=[]; | |
else | |
new_state=state.slice(); | |
new_state.push(action.item); | |
return new_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
library("dplyr") | |
deps<-read.csv("react_deps.csv") | |
repos<-read.csv("repos.csv") | |
tidy_repos<-deps %>% inner_join(repos) | |
temp<-tidy_repos %>% select(dependency) %>% mutate(name=dependency) %>% select(name) | |
tidy_repos<-tidy_repos %>% anti_join(temp) | |
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
library("tidyr") | |
num_of_deps<-tidy_repos %>% select(name, isDev) %>% | |
group_by(name, isDev) %>% count() %>% | |
spread(isDev, n, fill=0) %>% ungroup() %>% | |
select("dependencies"=`0`, "devDependencies"=`1`) | |
boxplot.stats(num_of_deps$dependencies)$stat | |
# [1] 1 5 10 20 42 | |
boxplot.stats(num_of_deps$devDependencies)$stat | |
# [1] 0 5 13 24 52 |
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 select_framework(r, emit) { | |
try{ | |
var package=JSON.parse(r.content); | |
if(package && package.dependencies){ | |
var deps = Object.keys(package.dependencies); | |
if(deps.indexOf("react")>=0){ | |
var row = {id:r.id, repo:r.repo, name:package.name}; | |
deps.forEach(function(dep){ | |
emit(Object.assign({}, row, {dependency : dep, isDev : 0 })); | |
}); |