Categories
Linux MySql Open Source Solutions

How to Rename Column in Mysql

To Rename a Column in Mysql we need to use the ALTER query with CHANGE COLUMN statement. The standard version of this query is:

ALTER [ONLINE | OFFLINE] [IGNORE] TABLE tbl_name
CHANGE [COLUMN] old_col_name new_col_name column_definition
[FIRST|AFTER col_name]


For Example:

ALTER TABLE City CHANGE CityId cityId varchar(25) NOT NULL;

Note: You will need to mention every constraint of the original column as defaults are assumed otherwise.

Categories
Laptop OsX

How To Take A ScreenShot on Mac

You can capture a Screenshot of your entire screen or just a selected portion of it. The screenshot is automatically saved to your desktop.

How to take a screenshot of your entire screen

  1. Press Shift+Command (⌘)+3.
  2. The screenshot will be saved as a .png file on your desktop

How to take a screenshot of a selected portion of your screen

how to take screenshot in mac

  1. Press Shift+Command (⌘)+4. The pointer changes to a crosshair.
  2. Move the crosshair to where you want to start the screenshot, then click and drag to select an area.
    Note: While dragging the Crosshair, you can hold Shift, Option, or Space bar to change the way the selection moves
  3. When you have selected the area that you want, release your mouse or trackpad button. To cancel, press the Esc (Escape) key before you release the button.
  4. The screenshot will be saved as a .png file on your desktop
Categories
Android Apps Device Nexus 5

Error 70 Gapps install – Fixed

If you are encountering the following error while trying to flash Gapps with your custom rom:

Error 70: Insufficient storage space available in System partition.

Here is the simple fix for the problem:

  • Flash a smaller size version of the Gapps ROM via TWRP.  Pick either Pico/Micro versions of the ram.
  • For Nexus 5 and CM14/Lineage the Micro Version works just fine
  • After installing the smaller version you can install the remaining apps via the Play Store

 

Categories
JavaScript Open Source Solutions Web

JavaScript Date Format YYYY-MM-DD

Here is a simple function that takes the input of JS Date and returns a string of format YYYY-MM-DD:

var getDateFromDateTime = function(date) {
date = new Date(date); //Using this we can convert any date format to JS Date
var mm = date.getMonth() + 1; // getMonth() is zero-based
var dd = date.getDate();
if(mm<10){ mm="0"+mm; } if(dd<10){ dd="0"+dd; } return [date.getFullYear(), mm, dd].join('-'); // padding };