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
| # config/routes.rb | |
| resources :posts, :only => [:index] | |
| # post.rb | |
| scope :recommended, where(:recommended => true) # having a guess on your db structure | |
| scope :recent, order('created_at DESC').limit(10) | |
| scope :popular, where(:like_count => true) # again having a guess | |
| # app/controllers/posts_controller.rb |
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
| Reference links | |
| http://robots.thoughtbot.com/post/22605580334/constrain-yourself | |
| https://github.com/hassox/warden/wiki/overview |
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
| li:before { | |
| content: '\b7\a0'; | |
| position: absolute; | |
| right: 100%; | |
| font-size: 20px; | |
| } | |
| li { | |
| list-style:none; | |
| position:relative; | |
| } |
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
| { | |
| "total": 100, | |
| "entries": [ | |
| { | |
| "title": "Wolf Creek", | |
| "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", | |
| "programType": "series", | |
| "images": { | |
| "Poster Art": { | |
| "url": "https://streamcoimg-a.akamaihd.net/000/128/61/12861-PosterArt-ec32a81986a45eac7e080112075ab466.jpg", |
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
| pragma solidity ^0.6.0; | |
| import "@chainlink/contracts/src/v0.6/ChainlinkClient.sol"; | |
| contract CoinGeckoConsumer is ChainlinkClient { | |
| address private oracle; | |
| bytes32 private jobId; | |
| uint256 private fee; | |
| uint256 public ethereumPrice; |
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
| /** This example code is designed to quickly deploy an example contract using Remix. | |
| * If you have never used Remix, try our example walkthrough: https://docs.chain.link/docs/example-walkthrough | |
| * You will need testnet ETH and LINK. | |
| * - Kovan ETH faucet: https://faucet.kovan.network/ | |
| * - Kovan LINK faucet: https://kovan.chain.link/ | |
| */ | |
| pragma solidity ^0.6.0; | |
| import "https://raw.githubusercontent.com/smartcontractkit/chainlink/develop/evm-contracts/src/v0.6/ChainlinkClient.sol"; |
OlderNewer