This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Car() { | |
this.speed = 0 | |
} | |
Car.prototype.accelerate = function(by) { | |
var self = this; | |
function throttler() { | |
if (by > 20) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var Geolocation = { | |
coordinates: {long:null, lat:null, timestamp:null, accuracy:null}, | |
capable: function(){ | |
//return false; | |
return Modernizr.geolocation?true:false; | |
}, | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"> | |
<title></title> | |
<link href="lib/ionic/css/ionic.css" rel="stylesheet"> | |
<link href="css/style.css" rel="stylesheet"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Ionic Starter App | |
// angular.module is a global place for creating, registering and retrieving Angular modules | |
// 'starter' is the name of this angular module example (also set in a <body> attribute in index.html) | |
// the 2nd parameter is an array of 'requires' | |
angular.module('starter', ['ionic']) | |
.run(function($ionicPlatform) { | |
$ionicPlatform.ready(function() { | |
if(window.StatusBar) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kenneth@poseidon:~/Projects/selenium2$ python | |
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) | |
[GCC 4.4.3] on linux2 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> from selenium import webdriver | |
>>> webdriver.Firefox() | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
File "/usr/local/lib/python2.6/dist-packages/selenium/webdriver/firefox/webdriver.py", line 45, in __init__ | |
self.binary, timeout), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium import webdriver | |
wd = webdriver.Firefox() | |
wd.get('http://www.google.com') | |
e = wd.find_element_by_id('lst-ib') | |
t = 'webdriver' | |
while True: | |
e.clear() | |
e.send_keys(t) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
popup = wd.switch_to_alert() | |
print popup.text | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> t = wd.find_element_by_css_selector("#dashboard-code") | |
>>> a = ActionChains(wd) | |
>>> a.key_down(k.SHIFT, t) | |
<selenium.webdriver.common.action_chains.ActionChains object at 0x1c17c50> | |
>>> a.send_keys(k.ENTER) | |
<selenium.webdriver.common.action_chains.ActionChains object at 0x1c17c50> | |
>>> a.key_up(k.SHIFT, t) | |
<selenium.webdriver.common.action_chains.ActionChains object at 0x1c17c50> | |
>>> a.perform() | |
Traceback (most recent call last): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kenneth@poseidon:~$ for i in `pidof firefox`; do cat /proc/${i}//maps |grep "libwebd\|ignore"; done | |
7fd45e4f5000-7fd45e4fc000 r-xp 00000000 08:01 3825433 /tmp/tmpIL7KSv/amd64/x_ignore_nofocus.so | |
7fd45e4fc000-7fd45e6fb000 ---p 00007000 08:01 3825433 /tmp/tmpIL7KSv/amd64/x_ignore_nofocus.so | |
7fd45e6fb000-7fd45e6fc000 r--p 00006000 08:01 3825433 /tmp/tmpIL7KSv/amd64/x_ignore_nofocus.so | |
7fd45e6fc000-7fd45e6fd000 rw-p 00007000 08:01 3825433 /tmp/tmpIL7KSv/amd64/x_ignore_nofocus.so |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def nextPage(self): | |
"""Continue to the next page. | |
IE is notorious for not registering click events. Let's make sure when | |
we go to the next page the state has changed. | |
Try 3 times. With a second of elapsed time between each try. | |
""" | |
initial = self.surveyState.getHTMLAttribute('value') | |
self.contBtn.click() |
OlderNewer