Skip to content

Instantly share code, notes, and snippets.

@qustosh
qustosh / gist:8451755
Created January 16, 2014 08:51 — forked from ElmahdiMahmoud/gist:8451662
js: hide a DIV when the user clicks outside of it
$(document).mouseup(function (e)
{
var container = $("YOUR CONTAINER SELECTOR");
if (!container.is(e.target) // if the target of the click isn't the container...
&& container.has(e.target).length === 0) // ... nor a descendant of the container
{
container.hide();
}
});
@qustosh
qustosh / Gruntfile.js
Created January 16, 2014 08:53 — forked from sgimeno/Gruntfile.js
A Gruntfile for Apache Cordova app development. Includes prepare, build and run tasks to mimic Cordova CLI commands. Usage: 'grunt <command> [platform]'. If no platform is provided Cordova will try to perform the task for all the installed platforms. Default task 'watch' watches for source changes and runs the prepare task.
module.exports = function ( grunt ) {
/**
* Load required Grunt tasks. These are installed based on the versions listed
* in `package.json` when you do `npm install` in this directory.
*/
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-exec');
@qustosh
qustosh / selenium_login_gmail.py
Created January 16, 2014 08:52 — forked from kingofhawks/selenium_login_gmail.py
Use selenium to auto login gmail account
import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver= webdriver.Firefox()
#driver= webdriver.Chrome("E:\QA\Resource\WEBDRIVER\chromedriverserver\chromedriver.exe")
driver.get("http://mail.google.com")