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
| import React, { Component, PropTypes } from 'React'; | |
| export const Enhance = ComposedComponent => { | |
| class WrappedComponent extends Component { | |
| attachFunction() { | |
| ComposedComponent.attachFunction(); | |
| } | |
| render() { | |
| return <ComposedComponent {...this.props} additionalProps={this.state.additionalData} />; | |
| } |
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
| <!-- language: lang-js --> | |
| import React, {Component, PropTypes} from 'react'; | |
| import ChildComp from './child-comp'; | |
| class Comp extends Component { | |
| render() { | |
| const { Wrapper } = this.props; | |
| return ( | |
| <Wrapper> |
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 MyComponent extends Component { | |
| handleClick = (args) => (event) => { | |
| // access args here; | |
| // handle the click event | |
| } | |
| render() { | |
| return ( | |
| <div onClick={this.handleClick(args)}> | |
| ..... |
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
| import { | |
| ACTIVATE_LOCATION | |
| } from './actions'; | |
| import Immutable from 'immutable'; | |
| let initialState = Immutable.Map([]); | |
| export let ui = (state = initialState, action) => { | |
| switch (action.type) { |
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
| EXEC sp_MSforeachtable @command1 = "DROP TABLE ?"; |
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
| /** | |
| * Created by shota on 5/10/16. | |
| */ | |
| import React, {Component} from 'react'; | |
| import {connect} from 'react-redux'; | |
| import {selectBook} from '../actions/index'; | |
| import {bindActionCreators} from 'redux'; | |
| class BookList extends Component { | |
| renderList() { |
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
| // === Arrays | |
| var [a, b] = [1, 2]; | |
| console.log(a, b); | |
| //=> 1 2 | |
| // Use from functions, only select from pattern | |
| var foo = () => { | |
| return [1, 2, 3]; |
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
| // DELETE specific rest resource | |
| curl -v -X DELETE http://localhost:8080/api/components/country/3 | |
| // POST specific rest resource (id is generated automatically) | |
| curl -i -X POST -H "Content-Type:application/json" http://localhost:8080/api/components/country -d '{"countryCode": "COW","countryName": "Cowland"}' | |
| // PUT (update) specific rest resource | |
| curl -i -X PUT -H "Content-Type:application/json" http://localhost:8080/api/components/country/5 -d '{"id": 5,"countryCode": "AS","countryName": "American COWA"}' |
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
| mvn package |
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
| // Add CATALINA_HOME env variable | |
| export CATALINA_HOME="/home/scabbard/programs/apache-tomcat-8.0.28" | |
| // Make it permanent by adding the command to this file | |
| sudo nano ~/.bashrc |