The basic idea is that when creating the “intent”, i.e. the action that you want Alexa to do, you also define “slots”. The slots are the variables; if this were a command line tool, they’d be the arguments you typed. It’s possible to include both intent and slots in your wording when you speak to Alexa, but equally you can just invoke the skill and have it prompt you for the rest of the information. Continue reading
Package Parameters in OpenWhisk
Where was that GitHub Discussion?
GitHub has brilliant advanced search functionality, and what I wanted was:
is:pr commenter:lornajane sort:updated-desc
Which gives me a list of all the pull requests I’ve commented on, with the most recent first. I couldn’t remember the exact repo name and I also often switch is:pr
for is:issue
as appropriate, but this search string has been very helpful for finding those odd things you want to follow up on.
Do you have a favourite GitHub search string combination? Would you care to share it in the comments? Thanks :)
Multiple Search Keys in CouchDB
One OpenWhisk Action Calls Another
Alexa Project Name Generator on OpenWhisk
Configuring Skills
There are a bunch of good resources around for setting up skills, picking the name, configuring the “invocation” which is what to say to make the code happen, and so on. I’ll skip this section and instead just share a couple of tutorials that I rely on a lot:
- https://jordankasper.com/building-an-amazon-alexa-skill-with-node-js/
- https://medium.com/@bthdonohue/build-your-first-alexa-skill-8a37dc3103d6#.h8ftaj84z
Once your skill is configured, it’s time to write the code (note: UK users need to pick English (UK) and not English (US) as otherwise your skill will mysteriously fail in your home region. Guess how I learned that??) Continue reading
Working With Sorted Sets in Redis
One-Line Command For Newest OpenWhisk Logs
wsk activation list -l1 | tail -n1 | cut -d ' ' -f1 | xargs wsk activation logs
From left to right, sections separated by the pipe |
character, this is what happens:
- get a list of activations, limited to just one activation (it sorts the newest one first by default)
- grab only the last line of that output (there’s some extra titles and stuff in there)
- use the `cut` command with the space character as a field delimiter, and use only the first field (this gets the ID of the activation)
- get the logs of that activation
Of course it’s wrapped up in a script so I just run that from the commandline and check where I went wrong this time …
Exclude a Directory when Grepping
node-modules
folder, try this:
grep -R --exclude-dir node_modules [what to search for] *
If you’re using a different tech stack you may want to exclude a different directory (for PHP, the directory would be called vendor
), but this is a very handy tip and a bit nicer than the older approach I was using which did the whole search and then used a second grep to eliminate things by using the -v
switch.