I was trying to understand JavaScript Promises by using various libraries (bluebird, when, Q) and other async approaches.
I read the spec, some blog posts, and looked through some code. I learned how to
pragma solidity ^0.4.6; | |
contract Splitter { | |
mapping(address => uint) public balances; | |
function unsafeSplit(address address1, address address2) | |
public | |
payable | |
returns(bool success) |
pragma solidity ^0.4.15; | |
contract C1 { | |
uint public num; | |
address public sender; | |
function callSetNum(address c2, uint _num) public { | |
if(!c2.call(bytes4(sha3("setNum(uint256)")), _num)) revert(); // C2's num is set | |
} | |
pragma solidity ^0.5.0; | |
contract Base { | |
uint x; | |
constructor() public { | |
x = 10; | |
} | |
// connect() is a function that injects Redux-related props into your component. | |
// You can inject data and callbacks that change that data by dispatching actions. | |
function connect(mapStateToProps, mapDispatchToProps) { | |
// It lets us inject component as the last step so people can use it as a decorator. | |
// Generally you don't need to worry about it. | |
return function (WrappedComponent) { | |
// It returns a component | |
return class extends React.Component { | |
render() { | |
return ( |
I was trying to understand JavaScript Promises by using various libraries (bluebird, when, Q) and other async approaches.
I read the spec, some blog posts, and looked through some code. I learned how to
Hi Nicholas,
I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:
The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't
/* | |
* modified from http://www.voidware.com/moon_phase.htm | |
*/ | |
function getMoonPhase(year, month, day) | |
{ | |
var c = e = jd = b = 0; | |
if (month < 3) { | |
year--; |
1. Open Terminal | |
2. cd to your Xcode project | |
3. Execute the following when inside your target project: | |
find . -name "*.[hm]" -print0 | xargs -0 wc -l |
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\