#!/bin/bash
sudo yum install gcc gcc-c++ make libxslt fop ncurses-devel openssl-devel *openjdk-devel unixODBC unixODBC-devel -y
cd /tmp
wget "http://erlang.org/download/otp_src_23.1.tar.gz" -O otp23.1.tar.gz
tar xfz otp23.1.tar.gz
This file contains hidden or 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
| $ git branch -r --merged | | |
| grep origin | | |
| grep -v '>' | | |
| grep -v master | | |
| xargs -L1 | | |
| cut -d/ -f2- | | |
| xargs git push origin --delete |
This file contains hidden or 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
| set nocompatible | |
| filetype off | |
| syntax enable | |
| " set pyx=3 | |
| set backspace=indent,eol,start | |
| " On pressing tab, insert 2 spaces | |
| set expandtab | |
| " show existing tab with 2 spaces width | |
| set tabstop=2 |
This file contains hidden or 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
| RUN wget -O /etc/ld-root-ca.crt http://repo.logdna.com/syslog/ld-root-ca.crt | |
| RUN echo $'### START LogDNA rsyslog logging directives ###\n\ | |
| \n\ | |
| ## TCP TLS only ##\n\ | |
| $DefaultNetstreamDriverCAFile /etc/ld-root-ca.crt # trust these CAs\n\ | |
| $ActionSendStreamDriver gtls # use gtls netstream driver\n\ | |
| $ActionSendStreamDriverMode 1 # require TLS\n\ | |
| $ActionSendStreamDriverAuthMode x509/name # authenticate by hostname\n\ | |
| $ActionSendStreamDriverPermittedPeer *.logdna.com\n\ | |
| ## End TCP TLS only ##\n\ |
This file contains hidden or 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 asyncAction(dispatchFn) { | |
| return function(Component) { | |
| class AsyncAction extends React.Component { | |
| static displayName = `Action(${Component.displayName})` | |
| fetchData() { | |
| return dispatchFn(props, dispatch); | |
| } | |
| render() { | |
| return <Component {...this.props} /> |
This file contains hidden or 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 UserImage extends React.Component { | |
| render() { | |
| return ( | |
| <div> | |
| <img src={this.props.userImageUrl} /> | |
| </div> | |
| ); | |
| } | |
| } |
This file contains hidden or 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 UserImageLoader extends React.Component { | |
| constructor() { | |
| if (window == undefined) { this.fetchData() } | |
| } | |
| fetchData() { | |
| return dispatch(loadUserImage(this.props.userId)); | |
| } | |
| render() { |
This file contains hidden or 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 UserImage extends React.Component { | |
| constructor() { | |
| if (window !== undefined) { this.fetchData() } | |
| } | |
| fetchData() { | |
| return dispatch(loadUserImage(this.props.userId)); | |
| } | |
| render() { |
This file contains hidden or 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 UserImage extends React.Component { | |
| constructor() { | |
| // getDataFromTree from react-apollo will call the | |
| // constructor and fetchData automatically so there's | |
| // no need to call it during SSR. This is here | |
| // so if the app is being rendered on the client, | |
| // it will still know to call fetchData. | |
| if (window !== undefined) { this.fetchData() } | |
| } | |
This file contains hidden or 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 loadUserImageUrlAction(userId) { | |
| return function(dispatch) { | |
| return fetch(USER_IMAGE_API) | |
| .then( | |
| res => res.json(), | |
| err => console.log('An error has occured.', err) | |
| ) | |
| .then(json => { | |
| dispatch(receiveUserImage(json)); | |
| }) |
NewerOlder