Skip to content

Instantly share code, notes, and snippets.

View ahmadmarafa's full-sized avatar

Ahmad Arafa ahmadmarafa

View GitHub Profile
@shakhmehedi
shakhmehedi / bash_backup_all_mysql_databases.sh
Created September 2, 2016 19:00
Bash scripts to backup all databases in a MySQL server with the option to exclude some databases.
#!/usr/bin/env bash
#This script backups selected databases in local MySQL server
#REQUIREMENTS
##mysqldump gzip
##mysql database has no root password. This script uses 'root' MySQL user without password as no 'root' password is set.
##This is not good practice. User with more restrictive permission should be used.
#set database user
<?php
/**
* Given a URL, normalize that URL.
* @param String URL
* @return String Normalized URL
*/
function normalizeUrl($url)
{
$newUrl = "";
$url = parse_url($url);
@navaneeth
navaneeth / cs.js
Created January 16, 2013 05:38
Firefox addon-sdk - document.activeElement not available on some pages
(function() {
self.port.on('init', init);
function init(data) {
var active = document.activeElement;
if (!active) {
console.log("Failed to get activeElement");
}
if (active != document.body) {