Implementation Guide: SUM values if font is bold – Google Drive Spreadsheet

Google Drive - Google Apps Script

This is second part of the guide of how to implement custom function into Google Drive Spreadsheets.

I have been receiving many questions how exactly use the script mentioned in previous part of this guide so I decided, that it would be better to write it down incl. screenshots.
Continue Reading

UPDATE: FATAL ERROR while cloning from Bitbucket private repository

FATAL ERROR: Disconnected: No supported authentication methods available (server sent: publickey)
If this is error, which You are getting form Bitbucket server while trying to clone Your private repository, you can try following:

  1. Start Git bash command line at the location where You want have Your repository cloned.
  2. Copy clone command from Your repository web page – like: git clone git@bitbucket.org:username/repositoryName.git ./desiredTargetFolderName
  3. first paste following command into bash: ssh -vT git@bitbucket.org
  4. Than run clone command and it should work

Hope it will help someone.

Update:

If You`re still having problems with pulling data  from Your repository (because of permission), check Your home ssh folder, if it contains correct public key file, usually it is:

~/.ssh/id_rsa.pub

Script: SUM values if font is bold – Google Drive Spreadsheet

Google Drive - Google Apps Script

I was working on some calculations using Google Drive Spreadsheet.
Than I found out, that I would need SUM values only from cells, which has bold font… Than I found out, that there is no simple way, how to do that with basic functions included in Spreadsheet application. That was the moment, when I found out, that there is option create a custom fuction by my own needs using Google Apps Script!
Continue Reading

UPDATE: Keep order of rows while using WHERE IN () – MySQL

I was just solving issue, where I needed to keep an order of items returned from the MySQL database listen in the WHERE IN clause.
Original query:

SELECT * FROM table WHERE id IN (1,5,8,73,5,4,88)

This will return rows ordered by its primary key (in my case column id). Here is updated query, which will keep order of items listed in WHERE IN clause:

SELECT * FROM table WHERE id IN (1,5,8,73,5,4,88) ORDER BY FIELD(id,1,5,8,73,5,4,88)

Please note first item in brackets behind ORDER BY – there should be set same column, which was used at WHERE IN clause.

UPDATE: There was missing function called FIELD after ORDER BY – code is fixed now.

Get rid of scrollbars in Facebook canvas application

First of all, make sure, that you have correct settings in Your Facebook app setup. To check it, go to: https://developers.facebook.com/apps

  1. on the left side choose You app
  2. than on the top right click on “Edit App” button
  3. On the left should be choosen: Settings -> Basic
  4. Go down into the section called: “Select how your app integrates with Facebook”
  5. Find setup for Page Tab and check if you have set correct width of used app layout (mine was 520px)
  6. Save changes, if anything changed
  7. Than on the left choose Settings -> Advanced
  8. In the section “Canvas Settings” should be following setup for canvas height: fluid

How get Facebook profile ID (uid) when using vanity URL

When You are working with facebook apps, you do need sometimes to add administrators or moderators to Your application. If selected person is not in Your friend list, You cannot add him to the list using auto-suggest box. Thats the moment, when You will need to know user`s facebook profile id (uid). Real problem is coming when user is using Facebook vanity URL for his/her profile (like www.facebook.com/some.selected.vanity.url). Continue Reading

Generate random birth date in MySQL table and get Age by select

Today I was solving generating of random data for testing and manipulation with the date of the birth.

Here are two simple SQL queries solving both:

Query for generate random date of birth in whole table

UPDATE

people

SET

date_of_birth=CONCAT_WS('-',(FLOOR( 1900 + RAND( ) *100)),(FLOOR( 1 + RAND( ) *12 )),(FLOOR( 1 + RAND( ) *28 )))

Query for selecting date of birth and calculation of age in MySQL:

SELECT
date_of_birth,
DATE_FORMAT(NOW(), '%Y') - DATE_FORMAT(date_of_birth, '%Y') - (DATE_FORMAT(NOW(), '00-%m-%d') < DATE_FORMAT(date_of_birth, '00-%m-%d')) AS age
FROM people

Cisco VPN on Windows 7 64bit

I just got to project, which is hosted on server, where the developers has to connect via Cisco VPN to upload stuff or access SSH. Problem is, that Cisco is unable to create client, which would run with no troubles on Windows 7 64bit!!! Solution is quiet simple: Continue Reading

Joomla: get category ID in template

I just needed to specify special layout for the articles of selected categories. I was looking for some solution online, but none of them worked. Mostly you can find this:

JRequest::getInt('catid');

or

JRequest::getInt('catid', '', 'get');

Continue Reading

Magento: Changing Tax class on all products

I was just asked to update tax classes on products in the catalogue. I found a easy and fast solution. Continue Reading