Skip to content

Instantly share code, notes, and snippets.

View kennethkoontz's full-sized avatar

Ken Koontz kennethkoontz

  • Squadformers
  • Squaw Valley, CA
View GitHub Profile
function Car() {
this.speed = 0
}
Car.prototype.accelerate = function(by) {
var self = this;
function throttler() {
if (by > 20) {
(function(){
var Geolocation = {
coordinates: {long:null, lat:null, timestamp:null, accuracy:null},
capable: function(){
//return false;
return Modernizr.geolocation?true:false;
},
<!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">
// 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) {
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),
@kennethkoontz
kennethkoontz / gist:1428075
Created December 3, 2011 20:35
webdriver bug repro script
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)
popup = wd.switch_to_alert()
print popup.text
@kennethkoontz
kennethkoontz / gist:2312654
Created April 5, 2012 17:22
webdriver action chain perform exception
>>> 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):
@kennethkoontz
kennethkoontz / gist:2312679
Created April 5, 2012 17:25
tmp firefox profile
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
@kennethkoontz
kennethkoontz / npage
Created August 7, 2012 18:15
nextpage
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()