This file contains hidden or 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
#!/usr/bin/env python | |
""" Spyglass is an email notification script for the Glass Shop. | |
Setup: | |
------ | |
Install Python 2.7.x and these additional libraries: requests, lxml. | |
Enter your own smtp server, smtp login details and notification email | |
recipient into the relevant fields in Spyglass.__init__. In order for | |
Spyglass to fetch the page, you will also need to copy the cookie | |
strings from an authenticated browser session (get this by logging |
This file contains hidden or 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
{ | |
"Type":"UnencryptedConfiguration", | |
"NetworkConfigurations":[ | |
{ | |
"GUID":"{%GUID_A%}", | |
"Name":"%NAME%", | |
"Type":"VPN", | |
"VPN":{ | |
"Type":"OpenVPN", | |
"Host":"%HOSTNAME%", |
This file contains hidden or 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 is_power_of_three(num): | |
from types import IntType, FloatType | |
assert type(num) in (IntType, FloatType) | |
x = 3 | |
if num in (0, 1): return True | |
elif num < 0: return False | |
elif num > 0 and num < 1: | |
while True: | |
y = 1.0/x #hacky.. | |
#print y, x |
This file contains hidden or 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
{ | |
"canonicalUrl": "http://en.m.wikipedia.org/w/index.php?curid=25658949", | |
"notification": { | |
"level": "DEFAULT" | |
}, | |
"menuItems": [ | |
{ | |
"action": "READ_ALOUD" | |
}, | |
{ |
This file contains hidden or 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
var goog = goog || {}; | |
goog.global = this; | |
goog.DEBUG = !0; | |
goog.LOCALE = "en"; | |
goog.TRUSTED_SITE = !0; | |
goog.provide = function (a) { | |
goog.exportPath_(a) | |
}; | |
goog.setTestOnly = function (a) { | |
if (!goog.DEBUG) throw a = a || "", Error("Importing test-only code into non-debug environment" + a ? ": " + a : "."); |
This file contains hidden or 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 test_all_apps_link(self): | |
p = self.init() | |
self.assert_elem(self.find_elem('xpath', '/div/div/a[1]', p), | |
{'inner' : 'All Applications', | |
'attrib': {'href': '/viewProjects.do', | |
'class': 'title colorMediumBlue hover'}, | |
'invoke': {'is_displayed': True}}) |
This file contains hidden or 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
Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on win32 | |
Type "copyright", "credits" or "license()" for more information. | |
==== No Subprocess ==== | |
>>> def factorial(n): | |
if n < 1: | |
sys.exit | |
elif n == 1: | |
return 1 | |
else: | |
return n * factorial(n-1) |
NewerOlder