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
# priv/repo/migrations/20160809055905_set_subscription_renew_for_users.exs | |
defmodule LearnPhoenix.Repo.Migrations.SetSubscriptionRenewForUsers do | |
use Ecto.Migration | |
alias LearnPhoenix.{Repo, User} | |
import Ecto.Query | |
def up do | |
set_subscription_renew = from(u in User, update: [set: [subscription_renew: true]]) | |
Repo.update_all(set_subscription_renew, []) |
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
# priv/repo/set_subscription_renew.exs | |
# This script is run with: | |
# mix run priv/repo/set_subscription_renew.exs | |
alias LearnPhoenix.{Repo, User} | |
import Ecto.Query | |
set_subscription_renew = from(u in User, update: [set: [subscription_renew: true]]) | |
Repo.update_all(set_subscription_renew, []) |
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
import React from 'react' | |
class App extends React.Component { | |
constructor(props) { | |
super(props) | |
this.state = { | |
counter: 0 | |
} | |
this.addOne = this.addOne.bind(this) | |
} |
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
import React from 'react' | |
import { connect } from 'react-redux' | |
import Actions from './Actions.js' | |
class App extends React.Component { | |
constructor(props) { | |
super(props) | |
this.addOne = this.addOne.bind(this) | |
} | |
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
import React from 'react' | |
class App extends React.Component { | |
constructor(props) { | |
super(props) | |
this.counter = 0 | |
this.addOne = this.addOne.bind(this) | |
} | |
addOne() { |
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
import React from 'react' | |
import { Socket } from 'phoenix' | |
class App extends React.Component { | |
componentDidMount() { | |
this.socket = new Socket('http://localhost:4000/socket') | |
this.socket.connect() | |
this.configureChannel("lobby") | |
} | |
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 App extends React.Component { | |
render() { | |
return (<div>{ this.props.title }</div>) | |
} | |
} | |
App.propTypes = { | |
title: React.PropTypes.string.isRequired | |
} |
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 App extends React.Component { | |
static propTypes { | |
title: React.PropTypes.string.isRequired | |
} | |
render() { | |
return (<div>{ this.props.title }</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
class App extends React.Component { | |
constructor() { | |
super() | |
this.prototypeProperty = { | |
baz: "qux" | |
} | |
} | |
static staticProperty = { | |
foo: "bar" | |
}; |
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 App extends React.Component { | |
static requiredData = [ | |
"username", | |
"email", | |
"thumbnail_url" | |
] | |
render() { | |
return(<div></div>) | |
} |