$ rails g model User
belongs_to
has_one
| # Traversing arrays and objects in CoffeeScript | |
| # The array and object we use for testing | |
| arr = [1, 2, 3, 4, 5] | |
| obj = {a: 1, b: 2, c: 3, d: 4, e: 5} | |
| # 'in' has a different meaning in CoffeeScript than in JavaScript | |
| # CS: element in array -> JS: array.indexOf(element) >= 0 | |
| console.log '5 in arr: ' + (5 in arr) |
| var page = require('webpage').create(), | |
| url = 'http://example.com/'; | |
| // Put the event handlers somewhere in the code before the action of | |
| // interest (opening the page in question or clicking something) | |
| // http://phantomjs.org/api/webpage/handler/on-console-message.html | |
| page.onConsoleMessage = function(msg, lineNum, sourceId) { | |
| console.log('CONSOLE: ' + msg + ' (from line #' + lineNum + ' in "' + sourceId + '")'); | |
| }; |
| // JSRPN - a simple console display javaScript RPN calculator | |
| // by Lars Johnson and Paul Gaston Gouron | |
| var RPN = function(string){ | |
| var poppush = function () { | |
| stack.pop() | |
| stack.pop() | |
| stack.push(value) | |
| } |
| require 'bitcoin' | |
| require 'money-tree' | |
| require 'bip44' | |
| require 'bech32' | |
| include Bitcoin | |
| include Bitcoin::Builder | |
| include Bitcoin::Protocol | |
| include Bitcoin::Util | |
| include Bitcoin::Secp256k1 |