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 assert = require('assert') | |
| var sinon = require('sinon') | |
| var dependency = require('dependency') | |
| var sut = require('./injection-sut') | |
| describe('sut', function () { | |
| var methodStub | |
| beforeEach(function () { | |
| methodStub = sinon.stub(dependency, 'method') |
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
| <!DOCTYPE HTML> | |
| <html> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
| <title>Quaderno.js for PayPal Subscriptions</title> | |
| <!-- jQuery is used only for this example; it isn't required to use Quaderno --> | |
| <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
| <!-- The required Quaderno lib --> |
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 animals = [ | |
| { name: 'Fluffykins', species: 'rabbit' }, | |
| { name: 'Caro', species: 'dog' }, | |
| { name: 'Hamilton', species: 'dog' }, | |
| { name: 'Harold', species: 'fish' }, | |
| { name: 'Ursula', species: 'cat' }, | |
| { name: 'Jimmy', species: 'fish' } | |
| ] |
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
| Byobu is a suite of enhancements to tmux, as a command line | |
| tool providing live system status, dynamic window management, | |
| and some convenient keybindings: | |
| F1 * Used by X11 * | |
| Shift-F1 Display this help | |
| F2 Create a new window | |
| Shift-F2 Create a horizontal split | |
| Ctrl-F2 Create a vertical split | |
| Ctrl-Shift-F2 Create a new session |
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
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
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 express = require('express'); | |
| var path = require('path'); | |
| var favicon = require('serve-favicon'); | |
| var logger = require('morgan'); | |
| var cookieParser = require('cookie-parser'); | |
| var bodyParser = require('body-parser'); | |
| //requestify | |
| var requestify = require('requestify'); |
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
| API v3 known endpoints: | |
| [GET with SESSION] | |
| https://SUBDOMAIN.api-us1.com/api/3/tags | |
| https://SUBDOMAIN.api-us1.com/api/3/tags/1 | |
| https://SUBDOMAIN.api-us1.com/api/3/contacts | |
| https://SUBDOMAIN.api-us1.com/api/3/contacts/7 | |
| https://SUBDOMAIN.api-us1.com/api/3/deals |
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
| axios({ | |
| url: 'http://localhost:5000/static/example.pdf', | |
| method: 'GET', | |
| responseType: 'blob', // important | |
| }).then((response) => { | |
| const url = window.URL.createObjectURL(new Blob([response.data])); | |
| const link = document.createElement('a'); | |
| link.href = url; | |
| link.setAttribute('download', 'file.pdf'); | |
| document.body.appendChild(link); |
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 mqtt = require('mqtt'); | |
| var Topic = '#'; //subscribe to all topics | |
| var Broker_URL = 'mqtt://192.168.1.123'; | |
| var options = { | |
| clientId: 'MyMQTT', | |
| port: 1883, | |
| keepalive : 60 | |
| }; |