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
| var model1 = new Model(); | |
| var model2 = new Model(); | |
| model1.save(); // Kinda slow | |
| doSomething(model1); | |
| model2.save(); // Kinda slow | |
| doSomething(model2); |
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
| var model1 = new Model(); | |
| var model2 = new Model(); | |
| model1.save(function(){ | |
| doSomething(model1); // get executed only when model1 is saved | |
| }); // Kinda slow | |
| model2.save(function(){ | |
| doSomething(model2); // get executed only when model2 is saved | |
| }); // Kinda slow |
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
| 'use strict'; | |
| var expect = require('chai').expect; | |
| var Voyage = require('../../lib/resources/voyage.js'); | |
| var _ = require("underscore"); | |
| describe('Voyage Class', function(){ | |
| it('should have a method called getVoyages', function(){ | |
| expect(Voyage.getVoyages).to.be.a('function'); |
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
| # Saving a product from database | |
| product = ShopifyAPI::Product.find(179761209) # This does an get http request to shopify api | |
| db_product = DBProduct.new # You have to create a new rails model | |
| db_product.shopify_id = product.id | |
| db_product.save | |
| # Saving a product to shopify | |
| product.title = 'changed' | |
| product.save # updates product in shopify, http put request |
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
| { | |
| "answer": { | |
| "text": "Persona a tu izquierda.", | |
| "type": "answer", | |
| "id": 116, | |
| "answers": 0 | |
| }, | |
| "keen": { | |
| "timestamp": "2017-07-26T03:16:18.688Z", | |
| "created_at": "2017-07-26T03:16:18.688Z", |
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: 151540, // esto es accountBalance | |
| funds: | |
| [ | |
| { category: 'userFunds', amount: 9000 }, | |
| { category: 'pendingPayments', amount: 6000 }, | |
| { category: 'workingCapital', amount: 60770 } | |
| ], | |
| lastUpdated: 2017-08-02T21:06:35.700Z, | |
| numericFormat: 'pennies', |
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
| const sum = (n1, n2) => (n1 + n2); | |
| describe('#sum', () => { | |
| it('should add both numbers', () => { | |
| expect(sum(1,2)).toMatchSnapshot(); | |
| }); | |
| }); |
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
| import React from 'react'; | |
| import PropTypes from 'prop-types'; | |
| import ListGroup from 'react-bootstrap/lib/ListGroup'; | |
| export default class List extends React.Component { | |
| static propTypes = { | |
| renderListItem: PropTypes.func.isRequired, | |
| items: PropTypes.arrayOf(PropTypes.any).isRequired, | |
| className: PropTypes.string, | |
| } |
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
| import React from 'react'; | |
| import PropTypes from 'prop-types'; | |
| export const getDefaultState = ( | |
| { | |
| username = '', | |
| password = '', | |
| shouldRememberUser = false, | |
| error = null, | |
| } = {} |
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
| version: '3' | |
| services: | |
| cats-mongo: | |
| image: mongo:latest | |
| environment: | |
| MONGO_INITDB_ROOT_USERNAME: mongo | |
| MONGO_INITDB_ROOT_PASSWORD: mongo | |
| MONGO_INITDB_DATABASE: cats | |
| volumes: | |
| - cats_mongodb_data:/data/db |