Skip to content

Instantly share code, notes, and snippets.

@foxwill
foxwill / scrollToElement.rb
Created October 17, 2016 18:25
Capybara Cucumber Ruby ScrollToElement
#where @session is Capybara::session instance
#and object is a Capybara::Node::Element istance
@session.driver.execute_script "window.scrollTo(#{object.native.location.x},#{object.native.location.y})"
return_string = object.native.click
@foxwill
foxwill / Events - OneLogin - OAUTH.py
Last active May 10, 2016 17:57
Get events by event type using an array of event types to retrieve
import onelogin
# specify client_id, client_secret, and shard (us or eu)
creds = {'client_id':'',
'client_secret':'',
'shard':''}
token = onelogin.Token(**creds)
# Create the events object with the token
onelogin_events = onelogin.Events(token)
@foxwill
foxwill / OAUTH - OneLogin - CreateUser.py
Last active July 12, 2020 20:51
Create a user in the OneLogin OAUTH Api
import onelogin
# specify client_id, client_secret, and shard (us or eu)
creds = {'client_id':'',
'client_secret':'',
'shard':'US'}
token = onelogin.Token(**creds)
# Create the user object with the token created
user = onelogin.User(token)
@foxwill
foxwill / OneLogin.py
Last active May 25, 2022 13:05
to create token object and use with the Users OAUTH api endpoint
import requests
class OneLogin(object):
def __init__(self, shard='US'):
"""
Specify the shard of the system being used (us or eu)
:param shard: us or eu
:return:
"""
@foxwill
foxwill / gist:01d20a6a07ca02b014d0
Created October 8, 2014 21:54
jquery_doc ready
$(document).ready(function(){
});
On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as saying through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free hour, when our power of choice is untrammelled and when nothing prevents our being able to do what we like best, every pleasure is to be welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty or the obligations of business it will frequently occur that pleasures have to be repudiated and annoyances accepted. The wise man therefore always holds in these matters to this principle of selection: he rejects pleasures to secure other greater pleasures, or else he endures pains to avoid worse pains.
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap 101 Template</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap -->
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css">