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
| { | |
| 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
| { | |
| "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
| # 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
| '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
| 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
| 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
| # LoopBack App Base Image | |
| FROM 4dstudios/loopback_app_base | |
| # Create App Directory and CD into it | |
| RUN mkdir /data/app | |
| WORKDIR /data/app | |
| # Clone Master and Install dependencies | |
| RUN git clone https://github.com/Rolilink/remote-job-board.git |
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
| # LoopBack App Base Image | |
| # Installs StrongLoop and Git | |
| FROM dockerfile/nodejs | |
| #Installing Loopback | |
| RUN npm install -g strongloop | |
| # Installing Git | |
| RUN mkdir /data/git-tmp | |
| WORKDIR /data/git-tmp |
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
| /** | |
| * Remove diacritics (accent and other marks) on characters, and dissociate double characters. | |
| * Based on the character map of http://lehelk.com/2011/05/06/script-to-remove-diacritics/ | |
| * but per-character walk (improved performance). | |
| * | |
| * Licensed under WTFPL v2 http://sam.zoy.org/wtfpl/COPYING | |
| */ | |
| var removeDiacritics = (function() { | |
| var diacritics = {"\u24B6":"A","\uFF21":"A","\u00C0":"A","\u00C1":"A","\u00C2":"A","\u1EA6":"A","\u1EA4":"A","\u1EAA":"A","\u1EA8":"A","\u00C3":"A","\u0100":"A","\u0102":"A","\u1EB0":"A","\u1EAE":"A","\u1EB4":"A","\u1EB2":"A","\u0226":"A","\u01E0":"A","\u00C4":"A","\u01DE":"A","\u1EA2":"A","\u00C5":"A","\u01FA":"A","\u01CD":"A","\u0200":"A","\u0202":"A","\u1EA0":"A","\u1EAC":"A","\u1EB6":"A","\u1E00":"A","\u0104":"A","\u023A":"A","\u2C6F":"A","\uA732":"AA","\u00C6":"AE","\u01FC":"AE","\u01E2":"AE","\uA734":"AO","\uA736":"AU","\uA738":"AV","\uA73A":"AV","\uA73C":"AY","\u24B7":"B","\uFF22":"B","\u1E02":"B","\u1E04":"B","\u1E06":"B","\u0243":"B","\u0182":"B","\u0181":"B", |