This file contains 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
This is a markdown file with a Python code block: | |
:::python | |
#!/usr/bin/env python | |
print "Hello world!" |
This file contains 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
// Using SHDocVw.ShellWindows and SHDocVw.IWebBrowser2 in C# | |
// | |
// VS 2012 edition! | |
// | |
// To do this you must add a reference to the COM component | |
// named "Microsoft Internet Controls" (AKA SHDocVw) | |
using SHDocVw; | |
// ... snip boilerplate code ... |
This file contains 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
# Borrowed from | |
# https://github.com/jfrazelle/dockerfiles/blob/master/kiwi-builder/Makefile | |
.PHONY: all build run shell clean | |
repo_name = myrepo/ghostdriver-py27 | |
all: run | |
build: |
This file contains 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 | |
# * Note: phantomjs must be in your PATH | |
# | |
# This script: | |
# - Navigates to www.google.com | |
# - Intentionally raises an exception by searching for a nonexistent element | |
# - Leaves behind a screenshot in exception.png | |
import unittest |
This file contains 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 | |
import unittest | |
from selenium import webdriver | |
class TestGoogleGhostDriver(unittest.TestCase): | |
def setUp(self): | |
# The phantomjs executable is assumed to be in your PATH: | |
self.driver = webdriver.PhantomJS('phantomjs') |
This file contains 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
# Find me at https://gist.github.com/2383726 | |
# | |
# This script shows how to use wprintf() and a few functions from the | |
# MS UI Automation COM interface (IUIAutomation) to print the name | |
# of the desktop's IUIAutomationElement on a Windows machine. | |
# For more information see the MS docs on: | |
# | |
# IUIAutomation::GetRootElement | |
# IUIAutomationElement::get_CurrentName | |
# |
This file contains 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
// Using SHDocVw.ShellWindows and SHDocVw.IWebBrowser2 in C# | |
// | |
// VS 2008 edition! | |
// | |
// To do this you must add a reference to the COM component | |
// named "Microsoft Internet Controls" (AKA SHDocVw) | |
SHDocVw.ShellWindows shellWindows = new SHDocVw.ShellWindowsClass(); | |
foreach (SHDocVw.IWebBrowser2 ie in shellWindows) |
This file contains 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
# Perl snippet showing how to use netcat (nc) to poll a port, | |
# waiting for it to open | |
# | |
# NOTE: You could also increase the value passed to -w to 60 | |
# to do this, but you wouldn't get an up-to-the minute status | |
# message printed each second... | |
my $host = '192.168.1.100'; | |
my $port = '443'; | |
my $MAX_ATTEMPTS = 60; # Number of times to repeat the port check |