Skip to content

Instantly share code, notes, and snippets.

View Tin-Nguyen's full-sized avatar

Tin Nguyen Tin-Nguyen

  • Unified
  • New York, USA
View GitHub Profile
@Tin-Nguyen
Tin-Nguyen / ec2-centos-ruby-rvm-nginx-passenger.md
Created October 27, 2015 15:38 — forked from dannguyen/ec2-centos-ruby-rvm-nginx-passenger.md
Setting up Ruby 1.9.3 stable, RVM, nginx, passenger on Amazon Linux AMI (CentOS)

Ruby 1.9.3 stable, RVM, nginx, passenger on Amazon Linux AMI (CentOS, 03-2013)

This combines the instructions on a few different tutorials:

[Sun May 15 03:24:45.236201 2016] [:error] [pid 26517] [client 127.0.0.1:38120] exception 'yii\\base\\InvalidConfigException' with message 'The 'label' option is required.' in /home/time/current/timesheet_ui/vendor/yiisoft/yii2-bootstrap/Nav.php:150\nStack trace:\n#0 /home/time/current/timesheet_ui/vendor/yiisoft/yii2-bootstrap/Nav.php(132): yii\\bootstrap\\Nav->renderItem(Array)\n#1 /home/time/current/timesheet_ui/vendor/yiisoft/yii2-bootstrap/Nav.php(119): yii\\bootstrap\\Nav->renderItems()\n#2 /home/time/current/timesheet_ui/vendor/yiisoft/yii2/base/Widget.php(96): yii\\bootstrap\\Nav->run()\n#3 /home/time/current/timesheet_ui/views/layouts/main.php(63): yii\\base\\Widget::widget(Array)\n#4 /home/time/current/timesheet_ui/vendor/yiisoft/yii2/base/View.php(315): require('/home/time/curr...')\n#5 /home/time/current/timesheet_ui/vendor/yiisoft/yii2/base/View.php(247): yii\\base\\View->renderPhpFile('/home/time/curr...', Array)\n#6 /home/time/current/timesheet_ui/vendor/yiisoft/yii2/base/Controller.php(368): y
Filter: ((lineitem_id)::text = ANY ('{00c392a6-0af1-4139-a477-6b6973be1d76,01877c7a-9722-419d-8173-58bba5502d45,01a2d661-0ba3-48c6-a2a6-2fd0259ba659,01a44ac7-6373-4096-95d4-de5b06b42358,021da122-0c0d-44e4-ace2-d32722a36306,03993c2a-2822-4afc-ab62-bde6b3cb893d,04397374-6ec0-4a3a-b269-4bff648c121d,04649c4a-d267-4324-9a91-d0acba698742,04c061b2-d09f-4079-8fc9-568034e6f4b0,05642e15-10cd-4af9-b1aa-5ca624a6b17b,05afdb5d-5018-445b-812d-3072615968e6,05e2521f-c85b-4938-b69c-64da7701847f,062bb901-66c0-4dc4-8509-023126bb6439,062f4edb-7f64-485b-b859-a954d4404bc9,06728b1e-2637-47ed-8233-8f65e421089c,0676fccb-5673-41c6-833f-fd36bac1acb0,0678c1e4-8719-4e77-9d35-d93a19ef4df9,078b1324-87fb-438e-952f-d68bcc7dbf02,079bffd3-9b9b-4847-a20f-1bd29522fd5b,07c7c0ff-f49c-4862-ad1e-bf98d64feb9e,08acc36f-5e90-427d-8681-53090af0e2cc,08d6453f-497c-4e92-bc40-d927213ee599,0975386d-d29c-4f27-b628-d70e482f6609,09badc0b-dd5c-4825-b5d9-91ffbbe53d9a,09c1d9c9-f643-40b1-8a88-308f303d2840,0a52ad4b-3cba-4785-bd7b-494012a1c56f,0a81ab71-bc8d-4ee2-9830
SELECT
lineitem_id,
spent_to_date,
budget_remain,
budget_complete_pct,
yesterday_media_spent,
avg_3day_media_spend,
true_pacing_pct,
pacing_trend_pct,
budget_at_risk,
2016-10-11 04:04:57,010 [INFO] platform_communique: Req UUID: '2f9def60-fd83-44bc-b024-a73e92b132c2' HTTP GET URL: 'https://stage-0001-elb-communique.unifiedsocial.com/v1/instagram/paid/raw?granularity=daily&click_attr=actions_28d&cost_calculation=owner_media_cost&breakout=none&line_item_id=1f67b3e4-28b8-48e6-b7b0-4a59191f527d&include_dark_social=false&include_custom_metrics=true&email=khoa.le%2Bprovideradmin%40unified.com&async=true&view_attr=actions_1d&format=xlsx&filename=RawDataReport_10.11.2016&start_date=06%2F16%2F2016&end_date=08%2F05%2F2016&columns=&brand_id=c6883ad3-9ae2-46f6-9870-30de548b98c9', Params: '{'format': 'xlsx', 'view_attr': 'actions_1d', 'start_date': '06/16/2016', 'breakout': 'none', 'brand_id': 'c6883ad3-9ae2-46f6-9870-30de548b98c9', 'click_attr': 'actions_28d', 'cost_calculation': 'owner_media_cost', 'async': 'true', 'include_custom_metrics': 'true', 'include_dark_social': 'false', 'end_date': '08/05/2016', 'line_item_id': '1f67b3e4-28b8-48e6-b7b0-4a59191f527d', 'filename': 'RawDataRep
class CounterButton extends React.Component {
constructor(props) {
super(props);
this.state = {count: 1};
}
shouldComponentUpdate(nextProps, nextState) {
return (this.props.color !== nextProps.color) ||
(this.state.count !== nextState.count);
}
class CounterButton extends React.PureComponent {
constructor(props) {
super(props);
this.state = {count: 1};
}
render() {
return (
<button
color={this.props.color}
class ListOfWords extends React.PureComponent {
render() {
return <div>{this.props.words.join(',')}</div>;
}
}
class WordAdder extends React.Component {
constructor(props) {
super(props);
this.state = {
// bad
componentWillMount() {
this.setState({
computedFoo: compute(this.props.foo)
});
},
componentWillReceiveProps(nextProps) {
this.setState({
computedFoo: compute(nextProps.foo)
});
// bad
{
isTrue
? <p>True!</p>
: <none/>
}
// good
{
isTrue &&