Skip to content

Instantly share code, notes, and snippets.

Resources:
AWSEBAutoScalingGroup:
Metadata:
AWS::CloudFormation::Authentication:
S3Auth:
type: "s3"
buckets: ["yourbucketname"]
roleName:
"Fn::GetOptionSetting":
Namespace: "aws:asg:launchconfiguration"
Resources:
sslSecurityGroupIngress:
Type: AWS::EC2::SecurityGroupIngress
Properties:
GroupId: {"Fn::GetAtt" : ["AWSEBSecurityGroup", "GroupId"]}
IpProtocol: tcp
ToPort: 443
FromPort: 443
CidrIp: 0.0.0.0/0
@bnhansn
bnhansn / 0002_sidekiq_initial.config
Created June 29, 2016 14:24
AWS Sidekiq Restart Configuration
---
restart_sidekiq: &RESTART_SIDEKIQ
mode: "000755"
content: |
#!/bin/bash
initctl restart sidekiq || initctl start sidekiq
ln -sf /var/app/current/log/sidekiq.log /var/app/containerfiles/logs/sidekiq.log
mute_sidekiq: &MUTE_SIDEKIQ
mode: "000755"
content: |
@bnhansn
bnhansn / index.js
Last active October 20, 2016 17:35
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import store from './store';
import App from './containers/App';
ReactDOM.render(
<Provider store={store}>
<App />
</Provider>
import { createStore, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import reducers from '../reducers';
const middleWare = [thunk];
const createStoreWithMiddleware = applyMiddleware(...middleWare)(createStore);
const store = createStoreWithMiddleware(reducers);
import { combineReducers } from 'redux';
import { reducer as form } from 'redux-form';
const appReducer = combineReducers({
form,
});
export default function (state, action) {
if (action.type === 'LOGOUT') {
return appReducer(undefined, action);
// @flow
import React, { Component } from 'react';
import { BrowserRouter, Match, Miss } from 'react-router';
import Home from '../Home';
import NotFound from '../../components/NotFound';
class App extends Component {
render() {
return (
<BrowserRouter>
// @flow
import React from 'react';
const Home = () =>
<div>Home</div>;
export default Home;
// @flow
import React from 'react';
import { Link } from 'react-router';
const NotFound = () =>
<div style={{ margin: '2rem auto', textAlign: 'center' }}>
<p>Page not found</p>
<p><Link to="/">Go to the home page →</Link></p>
</div>;
{
"parser": "babel-eslint",
"plugins": ["react", "flowtype"],
"extends": ["airbnb", "plugin:flowtype/recommended"],
"rules": {
"react/jsx-filename-extension": 0,
"import/prefer-default-export": 0,
"react/no-unused-prop-types": 0,
"camelcase": 0
},