Back to Android: First Impressions

As my iPhone 4S became painfully slow after updating to iOS 7 I didn't want to pay another fortune to Apple just to get a modern OS running smoothly. Also, there are some things really annoying me more and more on iOS, some of the worst being not to have an option to set a default browser and email client and not having global sharing/send-to-app options for third party apps. Also, I really like using GMail a lot and the performance of the iOS app is just a major PITA.

So, I got myself a new Nexus 5 and here are my first impressions as well as a little overview of the apps I quite liked so far.

Camera

I didn't expect to buy a device that's able to compete with the iPhone camera wise, so my expectations weren't too high. Still, in low light conditions I'm a bit underwhelmed by the quality it produces (a lot of noise). Also, I still haven't found the perfect camera replacement app suited for my needs. I think I'll get used to it and fiddle my way around. As with most cameras when light conditions are good image quality seems satisfying.

Different Image Presets depending on the number of images in a Drupal multi-field

The other day I had the task to display the image of a multi-upload image field with a bigger image style if there was only one image uploaded.

I solved it by using a combination of the following modules:

In the display settings of my content type I created a duplicate of my image gallery field using Display Suite's Dynamic Field. (You could also achieve this by using Display Suite's Code Field or creating a Computed Field that just outputs the value of your gallery field.)

For that new instance of my gallery field I set the desired bigger image style and the instruction to only show the first image if there are multiple.

Now I had the small gallery thumbnails and the big image being shown on node view.

Can't re-download previously purchased Program on the Mac AppStore

Mac AppStore failure

Today the Mac AppStore was bugging me quite a bit. I wanted to download and install an app that I had purchased some months ago. It failed with some message telling me I should try it from the Purchases tab of the AppStore. This looked like in the screenshot, the button didn't do anything (see screenshot). In the Applications folder there was an icon with an unfinished progress bar of the app I was about to install. I deleted it, but alone that didn't help.

Keep navigation bar fixed after scrolling to a certain element

Say you want to tack younav bar fixed at the top of the browser's viewport after a user has scrolled to a certain element in the DOM. In my example this is the menu itself. This snippet checks the vertical position of my main menu and adds a class to it after a visitor has been scrolling that far that it reached the top of the page.

Tags: 

Add proper mime types for web fonts

In case you're using web fonts and notice Chrome warning you with something along Resource interpreted as Font but transferred with MIME type application/octet-stream: ".../Content/Fonts/iconFont.ttf". you need to add the following to your .htaccess file:

# transfer fonts as proper mime types
AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType application/x-font-woff .woff

Found on StackOverflow

Display Drupal Nodes that share the same Taxonomy Term using Views 3

Yesterday I found a great little guide that comes in handy if you want to display nodes that share the same taxonomy term as a block, for instance to show related articles directly when viewing an article: Show related nodes in a block based on taxonomy terms with Views 3 and Drupal 7. It's originally based on another article at Metachunk: Adding a related content view in Drupal 7.

I just copied the steps over here for future me:

Override Drupal's form "required" asterisk to an arbitrary string

Great tip on overriding Drupal's required string using form api. Just put into your theme's template.php:

<?php
function THEME_form_required_marker($variables) {
  // This is also used in the installer, pre-database setup.
  $t = get_t();
  $attributes = array(
    'class' => 'form-required',
    'title' => $t('This field is required.'),
  );
  return '<span' . drupal_attributes($attributes) . '>(required)</span>';
}
?>

Source and further reading: http://knackforge.com/blog/selvam/drupal-form-api-overriding-required-fi...

Drupal 7 and Views 3: Date granularity for Grouping

Say you try to group events by date and you have several events at the same day but at different times. I thought I'd just add another date field to my view, set it to d.m.Y and group by that. Didn't work out, for every time of the day there will still appear a new group. The solution is simple: just strip all html tags for the date field you want to group by. This will remove any RDF attributes from the field, thus really having the same grouping values on a per-day-granularity. This will work for any other granularity as well, just add the desired date format and you're good to go!

Pages