Thursday, 24 December 2015

BlackBerry Link El Capitan USB connection unstable

Problem:

My BB10 BlackBerry device won't back up using BlackBerry Link in OS X El Capitan. The USB connection keeps dropping. USB is fine with all of my other devices.

Solution:

  • Make sure BlackBerry Link is installed, and your Mac has been restarted
  • Make sure your BlackBerry is plugged into your Mac via USB
  • Navigate to Apple Logo (top right) -> System Preferences -> Network
  • At the bottom of the list on the left, click the plus button + (this will add a network interface)
  • In the "Interface" drop down, note any BlackBerry interfaces that haven't already been added to the list (in the case of this machine, it was "BlackBerry (en4)")
  • Add the BlackBerry interface, and then hit "Apply"
  • Open BlackBerry Link, it might ask for your device password and then connect properly
  • If successful, operations such as backup will now work without dropping

Notes:

This was verified to work using OS X 10.11.2 (El Capitan), a BlackBerry Passport, and BlackBerry Link 1.2.2 (build 32). Your results may vary.

Some operations, such as syncing photos, might not work (i.e. iPhotos has now been replaced by Photos, and syncing photos requires iPhoto; other changes apply).

Additionally, the above steps worked on a machine with a fresh install of BlackBerry Link, and without BlackBerry Blend installed. If the above steps work or do not work with both software installed, please follow the links in the references section for more information.

References:

Monday, 7 December 2015

Snap SVG to whole pixel using CSS

Problem:

In most modern browsers and IE newer than IE9, how do I snap an SVG drawing container to the nearest sub-pixel?

Solution

Use the following CSS, where 'your-svg-container' is replaced by the actual ID or style class of your drawing inside your website.

#your-svg-container {
    /* svg */
    transform: translate(0, 0);
}

Notes:

This SVG style rule appears to work in many modern browsers. It can be useful if a website contains a SVG drawing that has elements that align to whole pixels, such as a grid. If such a drawing lands on a fraction of a pixel, it can appear blurry, depending on the browser's rendering engine.

This blurry alignment can happen when non-pixel alignment techniques are used, such as aligning to units such as em, %, or pt, or using computed alignment such as centered alignment (i.e. your drawing will be blurry upon every odd or even page size).

References:

Monday, 6 April 2015

Export open tabs in Chrome without a plugin (in order to share them with someone)

Problem:

How can I export open Chrome/Chromium tabs in order to share them? I have a bunch of tabs that a friend has opened in Chrome on my computer as part of some research that they were doing, and they would like to have a list of the opened tabs to continue working on their own computer.

Solution:

There are a few ways to share open tabs in Chrome. However, one of the easier ways to do this without a plugin is to simply bookmark all open tabs into a new bookmark folder, edit the saved bookmarks, export the bookmarks to a HTML file, and then share the HTML file. The file can be imported back into Chrome on another computer.

  • To bookmark all opened tabs, select in the main menu: Bookmarks -> Bookmark All Tabs
  • To edit the bookmarks: In the Bookmark Manager, create a new folder for the tabs and then edit out the ones you don't want to share
  • To export (while in the bookmark manager): 1) select a folder, 2) do one of the following (depending on your version of Chrome):
    • Click 'organize' (top of the right-hand side of the manager) -> Export Bookmarks to HTML file, or
    • Click the gear button -> Export Bookmarks

Importing these bookmarks in Chrome follows a similar process:

  • (main menu) -> Bookmarks -> Bookmark Manager
  • Organize -> Import Bookmarks from HTML File

References:

Tuesday, 31 March 2015

Insert image using only CSS

Problem:

How can I insert an image using only CSS?

Solution:

While there are many ways to do this, we will discuss one below.

Assuming the following html:


This is an image of an icon <span class="myicon"></span>

We can make the span display an icon using the following CSS for the class "myicon", with the stuff in bold being stuff you'll want to replace:


.myicon {
    display: inline-block; /* or 'block' if not inline */
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    background: url("path/to/your/image") no-repeat;
    background-size: 85pt 8.5pt; /* (optional) resize image */
    width: 85pt; /* Width of image */
    height: 8.5pt; /* Height of image */
    padding-left: 85pt; /* Equal to width of new image*/

    margin-left: 2pt; /* optional */
    margin-right: 2pt; /* optional */
}

Notes:

While the situation is not common, there can be cases where designers might only have access to the CSS and not the HTML, with the developer applying the desired class to the span or div for the designer. If yours is one of these situations then this trick can come in handy.

Note that you can also use this trick to add other content by using the 'content' attribute. While this is out of the scope of this post, you can feel free to experiment and see how it goes.

Also note that this trick will only work with CSS3 and beyond (because of the 'box-sizing' attribute).

References:

Thanks for over 200,000 views!

Thank you for over 200,000 page views!

I'm glad that so many people have found the information in this blog useful :)

As a bonus, here are two Android games that I made which are free as of now. Enjoy!

Friday, 12 December 2014

Sync shared Google calendars to BlackBerry Passport or BB10 device

Problem:

I have some Google calendars that were shared with me, however I cannot see them in my BlackBerry's calendar. How do I sync these shared calendars? As of now (December 2014) the official Google Calendar apps are not available on the Passport.

Solution:

  • Go to https://www.google.com/calendar/syncselect
  • Check any calendars that you want to sync
  • Go to the Passport/BB10 calendar and refresh (click menu button on bottom right, click refresh)
  • Wait for a few minutes until all events sync, they will show up then

Notes:

There have been other solutions online using third party apps or adding CalDAV accounts. However, for basic viewing needs the above solution seems to work. The CalDAV method is considered less secure by Google so it is not recommended.

This solution was tested in December 2014 to work using a BlackBerry Passport, OS version 10.3.0.908. Your results may vary using different OS versions, using different devices, or if Google changes their calendar in the future.

This was attempted in OS 7, however the shared calendars did not show up. Anyone out there have any luck with the older BB OS?

View full Google Calendar website with BlackBerry Passport

Problem:

How do I view the full Google Calendar website in my BlackBerry Passport's browser? When I go to calendar.google.com, Google brings me to the mobile version.

Solution:

Try the following URL: google.com/calendar/render

The site will show a dialog asking to confirm using the desktop version. If you click ok, the full calendar site should show up.

Notes:

Note that the full desktop site may not work fully or it may render slowly on mobile devices. It's a useful site to be able to log into however, as there are many options that can only be set using the full desktop site instead of the mobile site.

This solution was tested to work using the BlackBerry Passport, OS version 10.3.0.908, and the full Google Calendar site is accessible as of December 2014. Your mileage may vary using other versions and if Google decides to change Google Calendar in the future. Best of luck to you!

Monday, 29 September 2014

Test for shellshock bash bug vulnerability in OS X or Linux

Problem:

How do I quickly test if my computer is vulnerable to the shellshock Bash bug?

Solution:

One way to test the shellshock bug is to open a Terminal (in OS X, or any shell prompt in Linux, Cygwin, etc.), and try the following one-lined command:

x='() { :;}; echo VULNERABLE' bash -c :

If vulnerable, VULNERABLE should appear as part of the response. Otherwise if things are alright, you should get a response similar to the following:

bash: warning: x: ignoring function definition attempt
bash: error importing function definition for `x'

(Note that in some versions of fixed/patched bash shells, the above error won't show up but "VULNERABLE" will also not be printed to the terminal.)

Notes:

If you're unsure of any steps of the above instructions, see if you can find a friend who may be familiar with how to use bash shell and Terminal to try the above for you.

For more detail, check out the references below.

If your system happens to be vulnerable, and you're using Linux and don't know how to update your bash shell, try this post for instructions: http://linux.about.com/od/howtos/fl/How-To-Fix-The-BASH-Shellshock-Bug-On-Your-Linux-System.htm

NOTE: I won't be able to answer any questions about shellshock as I am not enough of an expert on this bug to comfortably respond. Sorry about that! I hope that this post still comes in handy to people out there.

References: