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
// Step 1: Create rich menu, and retrieve richMenuId | |
client.createRichMenu({ | |
size: { width: 2500, height: 1686 }, // Define size of rich menu | |
selected: true, // Always display | |
name: 'CryptoCurrency Page 2', // rich menu name | |
chatBarText: 'CryptoCurrency', // show to user | |
areas: [ // Area and action of each boundary | |
{ | |
bounds: { | |
x: 0, |
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
// File: index.js | |
// Express listen POST /webhook call and call handler.webhook() function | |
const app = express(); | |
app.post('/webhook', line.middleware(config), handler.webhook); | |
// File: handler/index.js | |
// Response {status: ok} to LINE call right away, but process the actual event in the background | |
const webhook = (req, res) => { | |
console.log("User id: " + req.body.events[0].source.userId) | |
Promise |
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
QUERY PLAN | |
------------------------------------------------------------------------------------------------ | |
Custom Scan (Citus Real-Time) (cost=0.00..0.00 rows=0 width=0) | |
Task Count: 32 | |
Tasks Shown: All | |
-> Task | |
Node: host=10.140.0.4 port=5432 dbname=temp_db | |
-> Bitmap Heap Scan on record_102008 record (cost=10.74..31.37 rows=850 width=4) | |
Recheck Cond: (id < 3) | |
-> Bitmap Index Scan on record_pkey_102008 (cost=0.00..10.53 rows=850 width=0) |
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
SELECT * from pg_dist_shard; | |
logicalrelid | shardid | shardstorage | shardminvalue | shardmaxvalue | |
---------------+---------+--------------+---------------+--------------- | |
github_events | 102026 | t | 268435456 | 402653183 | |
github_events | 102027 | t | 402653184 | 536870911 | |
github_events | 102028 | t | 536870912 | 671088639 | |
github_events | 102029 | t | 671088640 | 805306367 | |
(4 rows) |
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
SELECT create_distributed_table('table', 'id'); |
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 Result = React.createClass({ | |
propTypes: { | |
filterPokemon: React.PropTypes.array, | |
}, | |
render: function() { | |
return (<div> | |
<div>--- Total Filter Pokemon: {this.props.filterPokemon.length} ---</div> | |
<ul> | |
{this.props.filterPokemon.map(function (item, i) { | |
return <li key={i}>{item.name} (Atk: {item.attack}, Def: {item.defense})</li> |
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 Filter = React.createClass({ | |
propTypes: { // 1) assign expected parameter type | |
onFilterPokemonAtkChange: React.PropTypes.func, | |
onFilterPokemonTypeChange: React.PropTypes.func, | |
}, | |
render: function() { | |
return (<div id="filterBar"> | |
<label>Select Pokemon Type: </label> | |
<select name="type" id="pokemonTypeFilter" onChange={this.props.onFilterPokemonTypeChange}> {/* 2) assign event listener function for pokemon filter */} | |
<option value="">- ALL -</option> |
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 Pokedex = React.createClass({ | |
getInitialState: function() { // 1) Setup initial state | |
return { | |
filterPokemonType: null, | |
filterPokemonAtk: null, | |
}; | |
}, | |
filterPokemonByTypeAndMinAtk: function (allPokemons, filterPokemonType, filterPokemonAtk) { | |
// ... Filter function just like in jQuery | |
}, |
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 Result = React.createClass({ | |
render: function() { | |
return (<div> | |
<div>--- Total Filter Pokemon: {this.props.filterPokemon.length} ---</div> | |
<ul> | |
<li></li> {/* how each pokemon display */} | |
</ul> | |
</div>); | |
} | |
}); |
NewerOlder