Megan Taylor

front-end dev, volunteacher, news & data junkie, bibliophile, Flyers fan, sci-fi geek and kitteh servant

How to teach debugging

Sabotage: Teach Debugging By Stealth

“Not only does this help children spot errors in their own code more readily, but it also encourages them to consider using their peers for assistance more frequently.”

Really want to carry out this teaching strategy with my ScriptEd students.

March 19, 2015 | Comments Off on How to teach debugging | Categories: Links | Permalink

post

2014 Recap

In 2014…

I got my dream job!
I took a lot of pictures of my cats, but not enough.
We got a king-sized bed.
We finally went to Coney Island. Twice!
Cleo got her first professional grooming.
I quit smoking cigarettes!
My cat allergies resurfaced.
I ate a lot of really awesome food.
I cooked some really awesome food.
I started playing Ingress.
I made some amazing new friends.
I walked more than 300 miles playing Ingress.
I got to see old friends I hadn’t seen in a while.
I went to the Catskills and crushed apples for cider.
I met my nieces on my husband’s side of the family.
I spoke at a Meetup for the first time, and it was awesome!
I built some cool websites.
I went to the Brooklyn Botanical Gardens.
I saw Bloody Bloody Andrew Jackson in a park in Brooklyn.
I saw GWAR for the first time.
I celebrated 4 years of marriage to my amazing husband.
I spent some quality time with my mom, including seeing A Gentleman’s Guide to Love and Murder while she was visiting.
Cleo turned 9.
Pixel turned 1.
And lots more!

Here’s to an awesome 2015.

post

Todoist tasks to Dashclock widget Tasker task

Wow that title is hella awkward. This is a writeup of how I got my tasks in Todoist to show up in a Dashclock widget using Tasker.

Pre-reqs:

  • Be using Todoist :)
  • Have an Android phone
  • Install and have some basic knowledge of Tasker
  • Install and have some basic knowledge of Dashclock

So, there is pretty good documentation for most of this around the Internets, I’m going to try to be as detailed as possible, but this is not going to be a fool-proof step-through. More of a guideline. Kinda like the painted lines on the floor in hospitals? Anyway…

ACTIONS 1, 2 and 3

After all my poking and prodding and rewriting, my task in Tasker starts by clearing some variables that will be created later in the task. So the first action should be Variable Clear, and set the name to %Tasks (or whatever, this is going to be an array that holds the final format of all the tasks you pull from Todoist). Then make another Variable Clear action and set the name to %Item (this is going to be an individual task that will end up in the array mentioned above). Then make a third Variable Clear and set the name to %Numtask (this is going to increment with the number of tasks).

ACTION 4

For your fourth action, create an Array Clear and set the name to %TLIST. OK, we’re done with clears.

ACTION 5

The fifth task is going to actually pull you tasks from the Todoist API. I used the /API/query request.

Please review the API documents and get your query URL figured out before continuing. Mine looks like this: https://api.todoist.com/API/query?queries=[“overdue”, “yesterday”, “today”, “tomorrow”]&token=tokentokentoken. It gives me all the tasks that have not been completed that are overdue, due yesterday (for some reason on my account, overdue does not include yesterday. i have been in contact with todoist support and they haven’t figured out why, but using the yesterday query takes care of that for this use case), due today, or due tomorrow.

NOTE: The Dashclock widget will only show the first 5 tasks from the combined list of tasks. If you want to show more, you can create a separate widget for each query.

So create a HTTP Get action and set it up like this:
Server:Port
https://api.todoist.com
Path
API/query
(or whichever request you choose to use)
Attributes
queries=[“overdue”, “yesterday”, “today”, “tomorrow”]&token=tokentokentoken

I didn’t change anything else for this action.

Have I lost you yet? Great! Onward!

ACTION 6

Now I’m going to give you some JavaScript. This was the hardest part for me to figure out, because Tasker doesn’t really support true arrays. So I’m giving you the JavaScript that will parse the query response (assuming you used the same one I did, if not, you will have to edit this). You need to get this into a file on your phone somewhere.

jsonData = JSON.parse(global("HTTPD"));

var y = 0;

if (jsonData[0].data[0] !== 'undefined') {
for (i = 0; i < jsonData[0].data.length; i++) { setGlobal('TLIST'+y, jsonData[0].data[i].content); y++; } } if (jsonData[1].data[0] !== 'undefined') { for (i = 0; i < jsonData[1].data.length; i++) { setGlobal('TLIST'+y, jsonData[1].data[i].content); y++; } } if (jsonData[2].data[0] !== 'undefined') { for (i = 0; i < jsonData[2].data.length; i++) { setGlobal('TLIST'+y, jsonData[2].data[i].content); y++; } } if (jsonData[3].data[0] !== 'undefined') { for (i = 0; i < jsonData[3].data.length; i++) { setGlobal('TLIST'+y, jsonData[3].data[i].content); y++; } }

Create a JavaScript action (this will be number 6) and set the path to wherever you have stored this file on your phone.

ACTION 7

Create a seventh action, Variable Set. Name should be %Numtask and To should be %TLIST(#<)+1. I don't know why, but it works for me.

ACTION 8

Number eight! Create a For action. Set Variable to %Item and Items to %TLIST(0:).

ACTION 9

Your ninth action is part of a for loop that was initiated by number eight. Create a Variable Set action. Name is set to %Item. Leave To blank.

ACTION 10

For the tenth step create another Variable Set action. Name should be set to %Tasks and To should be set to %Item.

End the for loop with your next action. (Seriously, this is action number eleven, create an End For action).

ACTION 11

FINALLY. Create the Dashclock action.Set the title to %Numtask Tasks in order to display a title above your list in the widget that will say "N Tasks". Or leave it blank. Whatever. Set the body to %Tasks.

Now you have to add this task to a profile. I hope it works for you. Feel free to ask questions, suggest better flow/code or whatever.

September 17, 2014 | Comments Off on Todoist tasks to Dashclock widget Tasker task | Categories: Posts | Permalink

webclip

The Story Exchange

The Story Exchange is a nonprofit media organization dedicated to telling the personal and professional stories of women business owners.

Skills: WordPress, JavaScript, jQuery, CSS, HTML, Excel, CartoDB