-
Open a browser
# start an instance of firefox with selenium-webdriver driver = Selenium::WebDriver.for :firefox # :chrome -> chrome # :ie -> iexplore
- Go to a specified URL
| // | |
| // Regular Expression for URL validation | |
| // | |
| // Author: Diego Perini | |
| // Created: 2010/12/05 | |
| // Updated: 2018/09/12 | |
| // License: MIT | |
| // | |
| // Copyright (c) 2010-2018 Diego Perini (http://www.iport.it) | |
| // |
| *************************************************************************************************** | |
| DISCLAIMER: | |
| I did not write this, I found it on Stack Overflow attributed to user Sophtware. Finding it useful, I decided to save this here, in case SO deleted the page (since the question was closed as a non-question) | |
| *************************************************************************************************** | |
| void dumpViews(UIView* view, NSString *text, NSString *indent) | |
| { | |
| Class cl = [view class]; | |
| NSString *classDescription = [cl description]; |
| // Handy function to render dynamic parameters in a dust.js helper | |
| function renderParameter(name, chunk, context, bodies, params) { | |
| if (params && params[name]) { | |
| if (typeof params[name] === "function") { | |
| var output = ""; | |
| chunk.tap(function (data) { | |
| output += data; | |
| return ""; | |
| }).render(params[name], context).untap(); | |
| return output; |
| # | |
| # This config file is a combination of ideas from: | |
| # http://www.37signals.com/svn/posts/1073-nuts-bolts-haproxy | |
| # http://www.igvita.com/2008/05/13/load-balancing-qos-with-haproxy/ | |
| # http://wiki.railsmachine.com/HAProxy | |
| # http://elwoodicious.com/2008/07/15/nginx-haproxy-thin-fastcgi-php5-load-balanced-rails-with-php-support/ | |
| # http://upstream-berlin.com/2008/01/09/using-haproxy-with-multiple-backends-aka-content-switching/ | |
| # http://wiki.railsmachine.com/HAProxy | |
| # http://gist.github.com/raw/25482/d39fb332edf977602c183194a1cf5e9a0b5264f9 | |
| # |
| #!/usr/bin/env bash | |
| rm -rf "${HOME}/Library/Caches/CocoaPods" | |
| rm -rf "`pwd`/Pods/" | |
| pod update |
| // | |
| // Created by Alex Hajdu on 5/27/13. | |
| // Copyright (c) 2013 Mr.Fox and friends. All rights reserved. | |
| // | |
| // To change the template use AppCode | Preferences | File Templates. | |
| // | |
| #import <Foundation/Foundation.h> |
| // Just before switching jobs: | |
| // Add one of these. | |
| // Preferably into the same commit where you do a large merge. | |
| // | |
| // This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
| // and then it quickly escalated into more and more evil suggestions. | |
| // I've tried to capture interesting suggestions here. | |
| // | |
| // Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
| // @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
| #!/bin/bash | |
| ############################ | |
| #script function | |
| ############################ | |
| setProperty(){ | |
| awk -v pat="^$1=" -v value="$1=$2" '{ if ($0 ~ pat) print value; else print $0; }' $3 > $3.tmp | |
| mv $3.tmp $3 | |
| } | |
| ############################ |
| package com.sjl.util; | |
| import android.app.Activity; | |
| import android.app.Application; | |
| import android.content.Context; | |
| import android.os.Bundle; | |
| import android.os.Handler; | |
| import android.util.Log; | |
| import java.util.List; |