View feels like.js
This file contains 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 http = require( 'http' ); | |
var url = 'http://api.openweathermap.org/data/2.5/weather?zip=<YOURZIP>,us&units=imperial&APPID=<YOURAPPID>'; | |
http.get( url, function( response ) { | |
var data = ''; | |
response.on( 'data', function( x ) { data += x; } ); |
View password result.layout.html
This file contains 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
<layout mode="Details"> | |
<match> | |
PasswordResult (r) | |
</match> | |
<content> | |
<layout-macro id="common:card"> | |
<title>Your New Password</title> | |
<titleSize>large</titleSize> | |
<bodyText>{{r.Password}}</bodyText> | |
</layout-macro> |
View PasswordResult.dialog.bxb
This file contains 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
dialog (Result) { | |
match { | |
PasswordResult(this) { | |
from-output: generate(numWords) | |
} | |
} | |
template ("I generated a memorable, secure password for you using common english words:") | |
} |
View NumWords.dialog.bxb
This file contains 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
dialog (Concept) { | |
match { | |
// Look for this type | |
NumWords | |
} | |
// Use the following template text with this type | |
template("Number of Words") | |
} |
View PasswordResult.model.bxb
This file contains 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
structure (PasswordResult) { | |
description (The resulting password from the generate action.) | |
property (Password) { | |
description (The resulting password string from the generator.) | |
type (Password) | |
min (Required) | |
max (One) | |
} | |
property (length) { | |
description (The number of words used.) |
View numWords.bxb
This file contains 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
integer (NumWords) { | |
description (The number of number of words to use in the password.) | |
} |
View bixbyaction.bxb
This file contains 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
action (generate) { | |
collect{ | |
input (numWords) { | |
type (NumWords) | |
min (Required) | |
max (One) | |
// add a default value of four words, like the comic | |
default-init { | |
intent { | |
goal {NumWords} |
View bixbyendpoints.bxb
This file contains 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
endpoints { | |
authorization { | |
none | |
} | |
action-endpoints { | |
action-endpoint (generate) { | |
accepted-inputs (numWords) | |
local-endpoint ("generator.js") | |
} | |
} |
View generator.js
This file contains 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
// Correct Horse Battery Staple | |
// An implementation of the XKCD password algorithm https://xkcd.com/936/ | |
// The idea behind this generator is that randomized passwords are easy to guess | |
// and difficult to remember, while a password composed of four english words is | |
// both easy to remember and difficult to guess. This capsule adds the ability | |
// to generate such passwords to Bixby. | |
// Main entry point | |
function generate(numWords) { |
View extract_pdf_attachments.py
This file contains 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 PyPDF2 | |
def getAttachments(reader): | |
""" | |
Retrieves the file attachments of the PDF as a dictionary of file names | |
and the file data as a bytestring. | |
:return: dictionary of filenames and bytestrings | |
""" | |
catalog = reader.trailer["/Root"] |
NewerOlder