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"; | |
const oandaV20 = require('@oanda/v20/context'); | |
const fs = require('fs'); | |
var ctx = new oandaV20.Context('api-fxpractice.oanda.com', 443, true, "demo"); | |
var key = fs.readFileSync('api.key', {encoding: 'utf8'}); | |
//remove any bad chars (e.g. the trailing newline) | |
key = key.replace(/[^0-9a-fA-F-]/g, ""); | |
console.log(key); |
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 blessed = require("blessed"); | |
window.onload = function () { | |
var term = new Terminal({ | |
cols: 80, | |
rows: 24, | |
useStyle: true, | |
screenKeys: true | |
}); |
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 fs = require('fs'), | |
http = require('http'), | |
https = require('https'), | |
util = require('util'), | |
httpProxy = require('http-proxy'), | |
proxyTable = require('./proxy-table.js'); // proxy-table from the pre-caronte node-http-proxy | |
var routes_path = "routes.json"; |
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 on = window.Terminal.on; | |
var isGecko = navigator.userAgent.indexOf('WebKit')==-1 && navigator.product == 'Gecko'; | |
var isChromium = window.chrome; | |
// replace bindPaste with a variant that: | |
// 1. doesn't set contentEditable back to 'inherit' | |
// 2. replaces newlines with carriage returns in the clip | |
// 3. moves the caret (i.e. the contentEditable cursor) out of sight. | |
window.Terminal.bindPaste = function(document) { |
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 unorm = require('unorm'); | |
// These strings appear to be the same, but are NOT! | |
// String 1 is from a [track][location][path] extracted with Scripting Bridge from iTunes on Mac running an HFS+ filesystem | |
// String 2 is a path from an HFS+ filesystem mounted on Linux, then stored in an SQLite3 TEXT field. | |
// The file String 1 was derived from was copied from the file String 2 was derived from using rsync. | |
// Both strings then printed in Terminal.app and pasted into Emacs. | |
// Demonstration that two strings that appear the same might not be, even when they came from the same place originally. |
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
if (window.tty) { | |
tty.on('open', function() { | |
var tty = window.tty; | |
window.tty.socket.on('connect', function() { | |
console.log('connect ',window.tty.socket.socket.transport.name); | |
document.getElementById('help').innerHTML += "<p>" + window.tty.socket.socket.transport.name; | |
}); | |
}); | |
} |
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 util = require('util'); | |
require('NodObjC/global'); | |
framework('ScriptingBridge'); | |
var iTunes = SBApplication('applicationWithBundleIdentifier', | |
NSString('stringWithUTF8String', 'com.apple.iTunes')); | |
if (!iTunes('isRunning')) { | |
console.log('iTunes is not running'); | |
iTunes('run') |