Java

Rotating BufferedImage to left or right

If you need to rotate an BufferedImage to left or right you can use the following code

BufferedImage originalImage = // some image that you have as file / stream.
BufferedImage rotatedImage = new BufferedImage(originalImage.getHeight(), originalImage.getWidth(), originalImage.getType());

for (int row = 0; row < originalImage.getWidth(); row++) {
     for (int column = 0; column < originalImage.getHeight(); column++) {
         if (rotateLeft) {
              rotatedImage.setRGB(column, originalImage.getWidth() - row - 1, originalImage.getRGB(row, column));
         } else {
              rotatedImage.setRGB(originalImage.getHeight() - column - 1, row, originalImage.getRGB(row, column));
         }
     }
}
Mobile, Swift

Fixing Greyed tab icons with swift

To disable greyed tab bar icon and text in swift you can just do

self.tabBar.items?.forEach({ (item) -> () in
item.image = item.image?.imageWithRenderingMode(.AlwaysOriginal)
})
UITabBarItem.appearance().setTitleTextAttributes([NSForegroundColorAttributeName : UIColor.blackColor()], forState: UIControlState.Normal)