linkedin.com/in/phillip-lorenzo | github.com/pllearns
Contracts often act as a state machine, which means that they have certain stages in which they behave differently or in which different functions can be called. A function call often ends a stage and transitions the contract into the next stage (especially if the contract models interaction). It is also common that some stages are automatically reached at a certain point in time. Function modifiers can be used in this situation to model the states and guard against incorrect usage of the contract.
This file contains 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
DROP TABLE IF EXISTS users; | |
CREATE TABLE users ( | |
id SERIAL PRIMARY KEY, | |
facebook_id BIGINT, | |
linkedin_id BIGINT, | |
profile_created BOOLEAN DEFAULT false, | |
created_at DATE DEFAULT CURRENT_TIMESTAMP, | |
access_token VARCHAR(255) | |
); |
This file contains 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 createInnerCallback = require("./createInnerCallback"); | |
const DescriptionFileUtils = require("./DescriptionFileUtils"); | |
class DescriptionFilePlugin { | |
constructor(source, filenames, target) { | |
this.source = source; | |
this.filenames = [].concat(filenames); | |
this.target = target; | |
} |
This file contains 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
var http = require('http') | |
http.get(process.argv[2], (res) => { | |
res.setEncoding('utf8') | |
res.on('data', console.log) | |
res.on('error', console.error) | |
}).on('error', (e) => { | |
console.error(`Got error: ${e.message}`) | |
}) |
This file contains 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
var count = 0; | |
function cc(card) { | |
// Only change code below this line | |
switch(card) { | |
case 2: | |
case 3: | |
case 4: | |
case 5: | |
case 6: |
- Apply to 5 dream jobs
- Create 2 Frontend Templates
- Assist a fellow learner with a spec from their Get Hired goal
This file contains 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
'use strict' | |
class Stack { | |
constructor(capacity) { | |
this._capacity = capacity || Infinity | |
this._storage = {} | |
this._count = 0 | |
} | |
push(value) { |