Remove Duplicates From List – Quick and Easy

I needed a quick way to take my several thousand plus list of numbers and remove all duplicates. Just a one off task where I didn’t care about the original order of the list, only that there should be no duplicates. Enter python! Here’s how I did it.

  1. Open Terminal on Mac
  2. Type “python” and execute
  3. Format my numbers in an array like [39213123667, 532092995671, 659203651894,… in a text editor for easy copy and paste
  4. Use python’s set to remove duplicates and then convert back to a list and print out:
listWithDuplicates = [39213123667, 532092995671, 659203651894,...

# sets are unordered collections of distinct objects
deduplicated = list(set(listWithDuplicates))

# used this to see how many duplicates were removed
len(listWithDuplicates)
len(deduplicated)

# print out list to start doing real work
deduplicated

Amazon package not delivered how to

For those times when you find yourself yelling “My package never arrived!”…

When your Amazon shipment has been marked as delivered but you haven’t received it yet, bet sure to follow the steps outlined at https://www.amazon.com/gp/aw/help/id=201117310

After following those steps, if you still don’t have the package in your hands, visit http://amazon.com/gp/help/customer/contact-us/ and follow the steps to contact Amazon support about your missing package.

contact-amazon-package-not-delivered

In my case, the carrier had marked the package as delivered on a Friday and upon contacting Amazon, they said it would be delivered by end of day Monday.

Pass parameter to Ajax call to use after response returns

Let’s say I have some data I want to pass along with an ajax call to use when the response comes in. You can pass round trip parameters in your jQuery ajax call by adding them to the options object like this

$.ajax({
 url: 'www.example.com/some-api/',
 dataType: "json",
 roundTripVariable: 'Weeeeee!',
 success: function(data, textStatus, jqXHR) {
 // will print 'Weeeeee!' to the console
 console.log( this.roundTripVariable );
 }
});

Jira Filter – See my watched issues not assigned to me

To see issues in Jira that I am watching but are not assigned to me I created a new filter

issue in watchedIssues() AND assignee not in (currentUser())

Go to the filters view, select advanced, paste in the jql provided.

screen-shot-2016-09-07-at-11-28-41-am

screen-shot-2016-09-07-at-11-28-22-am

If you want to get fancy you could add another condition to show unresolved tickets like

issue in watchedIssues() AND assignee not in (currentUser()) AND resolution = Unresolved