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
| // Original source: | |
| // https://github.com/commonsmachinery/blockhash-js | |
| // Update for local file reading | |
| // Update (loosely) for ES6 | |
| // Removes dependencies from origina project | |
| class Blockhash { | |
| constructor() { | |
| this.canvas = document.createElement( 'canvas' ); | |
| this.canvas.style.visibility = 'hidden'; | |
| this.canvas.style.position = 'absolute'; |
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 json | |
| import requests | |
| import sys | |
| # Read configuration options | |
| with open( '../bluemix/config.json' ) as data_file: | |
| config = json.load( data_file ) | |
| # URL for Conversation API call | |
| url = '{0}{1}{2}{3}{4}'.format( |
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 request = require( 'request' ); | |
| // Router | |
| var router = express.Router(); | |
| // Send message to Conversation | |
| // Return found system entities | |
| router.post( '/message', function( req, res ) { | |
| // Build URL |
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
| <html> | |
| <head> | |
| <title>Tesseract</title> | |
| <style> | |
| body { | |
| align-items: center; | |
| display: flex; | |
| flex-direction: row; |
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
| { | |
| "key": "_your_key_here_", | |
| "secret": "_your_secret_here_" | |
| } |
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
| let template = document.querySelector( 'template.sentiment' ); | |
| let svg = template.content.querySelector( 'svg' ); | |
| let colors = ['#9575CD', '#5E35B1', '#311B92']; | |
| let radius = ( this.root.clientWidth * 0.80 ) / 2; | |
| let rotation = 0; | |
| let slices = [ | |
| ( value.negative / value.total ) * 100, | |
| ( value.nuetral / value.total ) * 100, | |
| ( value.positive / value.total ) * 100 |
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
| let foo = ( { | |
| a: () => { return 'a'; }, | |
| b: () => { return myFunction; } | |
| } )[bar] || 3; |
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
| // Phase 1 - Create additional elements | |
| let dummy = document.createElement( 'textarea' ); | |
| document.body.appendChild( dummy ); | |
| // Phase 2 - Parse, format, and place on clipboard | |
| // Repeat as needed for each selected book | |
| let notes = document.querySelectorAll( 'span[id=\'highlight\']' ); | |
| let pages = document.querySelectorAll( 'span[id=\'annotationHighlightHeader\']' ); | |
| let output = ''; |
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
| <html> | |
| <head> | |
| <title>Image Processing Worker</title> | |
| <style> | |
| body { | |
| align-items: center; | |
| display: flex; | |
| flex-direction: column; |
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
| class Captions { | |
| // Constructor | |
| constructor() { | |
| // Holds audio dialog | |
| this.conversation = []; | |
| // Watson logo | |
| // Used as proxy for file selector | |
| // Allowing for customization of interaction | |
| let watson = document.querySelector( 'button.file' ); |