Mac AppleScript launch Google Chrome in kiosk mode

If like me, you try to execute google Chrome on a mac, in full screen mode with appleScript, this is a simply solution how to do this.
I hope, it will helps you.

tell application "Google Chrome"
	if it is running then
                quit
	else
		activate
		open location "http://mywebsite.com"
		delay 1
		activate
		tell application "System Events" to keystroke "f" using {command down, shift down}
	end if
end tell
Advertisements
Mac AppleScript launch Google Chrome in kiosk mode

Git clone and pull from command line without prompt

If you have ever tried to clone or pull a private git repository from command line, you surely face the prompt for username and password.

This is a quick way to solve this problem:

git clone https://username:password@github.com/username/repository.git

This command also work for git pull

git pull https://username:password@github.com/username/repository.git

It saved me a lot of time to monitor a git repository from command line, I hope it will help you.

Git clone and pull from command line without prompt

Cannot delete or update a parent row: a foreign key constraint fails

If you have encountered this error, this is maybe because:

  1. There is a table within another schema (“database” in mysql terminology) which has a FK reference
  2. The innodb internal data dictionary is out of sync with the mysql one.

To apply your queries, simply bypass foreign keys security check.
This is the solution:

SET FOREIGN_KEY_CHECKS=0;
YOUR_QUERY here

After your queries have been done, reset to default foreign keys security check:

SET FOREIGN_KEY_CHECKS=1;

You’re done.

Cannot delete or update a parent row: a foreign key constraint fails