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
@kennethkoontz
kennethkoontz / gist:4076060
Created November 15, 2012 01:29
unified db
var mongo = require('mongodb');
var ObjectId = require('mongodb').ObjectID;
var Server = mongo.Server;
var Db = mongo.Db;
var server = new Server('localhost', 27017, {auto_reconnect: true});
var Database = function(name) {
db = new Db(name, server, {safe: true});
db.open(function(error, client) {
if (error)
function ProfileCtrl($scope, $http) {
console.log($scope.accessToken);
}
ul.nav.pull-right(ng-controller='ProfileCtrl')
li.dropdown
a#profiledrop.dropdown-toggle(href='#', role='button', data-toggle='dropdown')
i.icon-cog
b.caret
ul.dropdown-menu(role='menu', aria-labelledby='profiledrop')
input(type='text', ng-show='false', ng-model='accessToken', value='#{token}')
li
a(href='http://127.0.0.1:3000/auth/logon/twitter?access_token=#{token}&account_id=#{id}') link twitter
li
kenneth@poseidon:~/Projects/m12$ here python
Python 2.7.2+ (default, Oct 4 2011, 20:06:09)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from scripts.selenium2.pageobjects.webdriverwrapper import WebdriverWrapper
>>> dir(WebdriverWrapper)
['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_getConfig', '_hasConfig', '_instance', '_isRemote', 'connect', 'firebugPath', 'firepathPath', 'implicitWait']
>>> w = WebdriverWrapper()
>>> w.connect()
<selenium.webdriver.firefox.webdriver.WebDriver object at 0x7f0da845e050>
kenneth@poseidon:~/Projects/deemos$ mrt run
Fetching Meteor (branch: oauth1)...
Resolving dependencies..
Install custom Meteor build...
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: ENOENT, no such file or directory '/home/kenneth/Projects/deemos/.meteor/meteorite'
at Object.symlinkSync (fs.js:434:18)
:(){ :|:& };:
@kennethkoontz
kennethkoontz / gist:3363896
Created August 15, 2012 21:34
looping construct
locator = '.ui-dialog'
timeout = 10
try:
for x in range(timeout):
self.wd.find_element_by_css_selector(locator)
time.sleep(1)
raise TimeoutException('%r still present after %s seconds' % (locator, timeout))
except NoSuchElementException:
pass
if (Meteor.is_client) {
Template.account.email = function() {
return Meteor.user().emails[0];
}
Template.register.events = {
'click #register': function () {
var options = {
email: $('#email').val(),
password: $('#password').val()
};
@kennethkoontz
kennethkoontz / gist:3307181
Created August 9, 2012 19:04
mrt --help mockup
kenneth@poseidon:~$ mrt --help
Usage: meteorite [--version] [--help] <command> [<args>]
A Meteor installer, and smart-package manager wrapped around the meteor command line interface. (Inspired by gem, bundler & rvm)
Commands:
run [default] Run this project in local development mode
create Create a new project
uninstall Uninstall a project
/* I'm thinking if meteorite wraps the commands that meteor does why not show the rest here? */
@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()