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
| $data = json_decode($result['payment_custom_field']); | |
| print_r($data); | |
| echo '***'; | |
| if(isset($data['3'])){ | |
| echo $data['3']; | |
| $a = $data['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
| const add = (x, y) => x + y | |
| console.log(add(2,3)) // 5 |
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
| const add = (x, y) => x + y | |
| const minus = (x, y) => x - y | |
| const logSomeThing = (func) => (...args) => { | |
| console.log(func(...args)) | |
| } | |
| const logAdd = logSomeThing(add) | |
| const logMinus = logSomeThing(minus) | |
| logAdd(20, 5) // 25 |
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
| const CalculateWrapper = (WrappedComponent, operation) => (props) => ( | |
| <div> | |
| <div>{props.x + operation + props.y}</div> | |
| <WrappedComponent {...props} /> | |
| </div> | |
| ) | |
| const Increment = (props) => ( <h1>{props.x + props.y}</h1> ) | |
| const Decrease = (props) => ( <h1>{props.x - props.y}</h1> ) |
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
| #include<iostream> | |
| #include<stdio.h> | |
| using namespace std; | |
| typedef struct _NODE { | |
| int val; | |
| struct _NODE *left; | |
| struct _NODE *right; | |
| int weight; |
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
| SELECT CustNo, CustFirstName, CustLastName, CustCity | |
| fROM Customer | |
| WHERE CustBal > 150 and CustNo in | |
| (SELECT CustNo FROM OrderTbl WHERE OrderTbl.OrdDate between '2550/02/1' and '2550/02/28') | |
| SELECT CustNo, CustFirstName, CustLastName | |
| fROM Customer | |
| WHERE EXISTS | |
| (SELECT * FROM OrderTbl WHERE Customer.CustNo = OrderTbl.CustNo and Customer.CustState = 'CO' and OrderTbl.OrdDate < '2550/02/1' or OrderTbl.OrdDate > '2550/02/28' GROUP BY OrderTbl.CustNo) |
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
| #include<stdio.h> | |
| #include<vector> | |
| using namespace std; | |
| int main() { | |
| int n; | |
| vector<int> a[100000]; | |
| int num[100000]; | |
| int size = 0; |
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
| const Component = props => ( | |
| <div> | |
| Count: {props.count} | |
| <button onClick={props.increase}>Increment</button> | |
| <button onClick={props.decrease}>Decrement</button> | |
| </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
| import { compose, withState, withHandlers } from recompose | |
| const enhance = compose( | |
| withState('count', 'setCounter', 0), | |
| withHandlers({ | |
| increase: ({ setCounter }) => () => setCounter(n => n + 1), | |
| decrease: ({ setCounter }) => () => setCounter(n => n - 1), | |
| }) | |
| ) | |
| export default enhance(Component); |
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 { compose, withProps } from recompose | |
| class RefsStore { | |
| store(name, value) { | |
| this[name] = value; | |
| } | |
| } | |
| const enhance = compose( | |
| withProps({ refs: new RefsStore() }), | |
| ) |