Skip to content

Instantly share code, notes, and snippets.

View storenth's full-sized avatar

Kirill Zhdanov storenth

View GitHub Profile

Setup modern.ie vagrant boxes

Since modern.ie released vagrant boxes, it' no longer necessary to manually import the ova file to virtualbox, as mentioned here.

However, the guys at modern.ie didn't configured the box to work with WinRM. This how-to addresses that, presenting steps to proper repackage these boxes, adding WinRM support. Additionally configures chocolatey package manager and puppet provisioner.

Pre-requisites

import alpaca_trade_api as tradeapi
api = tradeapi.REST(key_id=<your key id>,secret_key=<your secret key>)
class positionHandler:
def __init__(self,startingBalance=10000,liveTrading=False):
self.cashBalance = startingBalance
self.livePositions = {} # Dictionary of currently open positions
self.openOrders = [] # List of open orders
self.positionHistory = [] # List of items [Symbol, new position size]
@storenth
storenth / drag_and_drop_helper.js
Created June 7, 2018 15:46 — forked from rcorreia/drag_and_drop_helper.js
drag_and_drop_helper.js
(function( $ ) {
$.fn.simulateDragDrop = function(options) {
return this.each(function() {
new $.simulateDragDrop(this, options);
});
};
$.simulateDragDrop = function(elem, options) {
this.options = options;
this.simulateEvent(elem, options);
};
@storenth
storenth / SeleniumClicks.py
Created May 12, 2018 13:38 — forked from rinchik/SeleniumClicks.py
Double-click + click in Python Selenium for rich tables editing
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
def enter_hours(self, cell, amount):
#Double-click
actions = ActionChains(self.driver)
actions.move_to_element(cell)
actions.double_click(cell)
actions.perform()
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from datetime import datetime
class BruteForce:
URL = 'http://localhost:3333'
character_list = 'abcdefghijklmnopqrstuvwxyz'
@storenth
storenth / CapitalOneInvestingSeleniumLoging.py
Created May 12, 2018 13:31 — forked from rinchik/CapitalOneInvestingSeleniumLoging.py
Capital One Investing login from the home page method
def login(self):
print 'Login ...'
self.driver.get(self.capital_url) # capital_url - Capital One Investing home page url
username_field = self.driver.find_element_by_css_selector('input#widget_signInUsername')
username_field.clear() # clear() is required for their form or send_key() below will fail
username_field.send_keys(self.username)
password_field = self.driver.find_element_by_css_selector('input#widget_signInPassword')
password_field.clear()
password_field.send_keys(self.password)
submit = self.driver.find_element_by_css_selector('#widget > div.SignInButtonWrapper > div.SignIn > a')
@storenth
storenth / ScreenAnalysis.py
Created May 12, 2018 13:28 — forked from rinchik/ScreenAnalysis.py
Analyzing and finding differences between 2 screenshots captured with Selenium in Python
from PIL import Image, ImageDraw
from selenium import webdriver
import os
import sys
class ScreenAnalysis:
STAGING_URL = 'http://www.yahoo.com'
PRODUCTION_URL = 'http://www.yahoo.com'
driver = None