Skip to content

Instantly share code, notes, and snippets.

View jollychang's full-sized avatar
🎼
Focusing

William Zhang jollychang

🎼
Focusing
View GitHub Profile
@hugs
hugs / selenium-examples.py
Created February 16, 2011 19:40
Example code for using the Selenium 2 Python bindings.
# To install the Python client library:
# pip install -U selenium
# Import the Selenium 2 namespace (aka "webdriver")
from selenium import webdriver
# iPhone
driver = webdriver.Remote(browser_name="iphone", command_executor='http://172.24.101.36:3001/hub')
# Android
:⌉
=⌉
¦-) as opposed to |
⍥ om nom nom
@evilchili
evilchili / git-hook-functions.sh
Created October 4, 2011 20:17
function library for git hooks & a post-receive hook for automatic branch building
#!/bin/bash
GIT_DIR=$(git rev-parse --git-dir 2>/dev/null)
if [ -z "$GIT_DIR" ]; then
echo >&2 "fatal: hooks/functions: GIT_DIR not set"
exit 1
fi
read oldrev newrev refname
@jonathanpenn
jonathanpenn / unix_instruments.sh
Last active January 26, 2016 19:09
Make Instruments play nice with unix by returning > 0 status code if build fails
#!/usr/bin/env bash
#
# Copyright (c) 2013 Jonathan Penn (http://cocoamanifest.net)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@davehunt
davehunt / README.md
Created December 1, 2011 13:27
pytest issue 93 example test case

install required python modules

sudo pip install pytest pytest-xdist selenium

download selenium server

curl http://selenium.googlecode.com/files/selenium-server-standalone-2.14.0.jar -o selenium-server-standalone-2.14.0.jar

Adrian -

I appreciate that you spent time in writing this post. I know I've been up until 2am writing similarly long ones as well. I will take responsibility for having what is likely an irrational response (I blame Twitter for that) to the term "NoOps", but I invite you to investigate why that might be. I'm certainly not the only one who feels this way, apparently, and thus far have decided this issue is easily the largest distraction in my field I've encountered in recent years. I have had the option to simply ignore my opposition to the term, and just let the chips fall where they may with how popular the term "NoOps" may or may not get. I have obviously not taken that option in the past, but I plan to in the future.

You're not an analyst saying "NoOps". Analysts are easy (for me) to ignore, because they're not practitioners. We have expectations of engineering maturity from practitioners in this field of web engineering, especially those we consider leaders. I don't have any expectations from analysts,

# SUMMARY
# This gist shows a performance test between a few different variations of Selenium,
# running against Rsel's unit-test sinatra site (https://github.com/a-e/rsel)
# It repeats these steps 20 times:
#
# - Click "About this site" link
# - Go back to the homepage
# - Click "Form test" link
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->
@stackedsax
stackedsax / registerAndroid.sh
Created May 3, 2012 01:55
poor man's flynnid.py for registering android emulators in bash
#!/bin/bash
HUB_HOST="hostname"
HUB_PORT="4444"
LOCAL_IP="ip"
SOCAT_PORT="8081"
JSON="{'configuration': {'registerCycle': 5000, 'hub': 'http://<HUB_HOST>:<HUB_PORT>/grid/register', 'host': '<LOCAL_IP>', 'proxy': 'org.openqa.grid.selenium.proxy.DefaultRemoteProxy', 'maxSession': 1, 'port': <SOCAT_PORT>, 'hubPort': <HUB_PORT>, 'hubHost': '<HUB_HOST>', 'url': 'http://<LOCAL_IP>:<SOCAT_PORT>', 'remoteHost': 'http://<LOCAL_IP>:<SOCAT_PORT>', 'register': true, 'role': 'node'}, 'class': 'org.openqa.grid.common.RegistrationRequest', 'capabilities': [{'seleniumProtocol': 'WebDriver', 'platform': 'ANDROID', 'browserName': 'android', 'version': null, 'maxInstances': 1}]}"
JSON=${JSON//<HUB_HOST>/$HUB_HOST}
JSON=${JSON//<HUB_PORT>/$HUB_PORT}
@mockee
mockee / check_ctrip_price.js
Created May 5, 2012 15:18
Check the price of Ctrip tourism product
var http = require('http'),
jsdom = require('jsdom'),
nodemailer = require('nodemailer');
smtpTransport = nodemailer.createTransport('SMTP', {
service: 'Gmail',
auth: {
user: 'username@gmail.com',
pass: 'password'
}