-
Open a browser
# start an instance of firefox with selenium-webdriver $browser_type = 'firefox' $host = 'http://localhost:4444/wd/hub'
$capabilities = array(\WebDriverCapabilityType::BROWSER_NAME => $browser_type);
# linux 64bit | |
$ GOOS=linux GOARCH=amd64 go build | |
# with the -o option to specify the name of the generated binary file | |
$ GOOS=linux GOARCH=amd64 go build -o app.linux | |
# linux 32bit | |
$ GOOS=linux GOARCH=386 go build | |
# windows 64bit | |
$ GOOS=windows GOARCH=amd64 go build |
import UIKit | |
public extension UITableView { | |
public func beginRefreshing() { | |
// Make sure that a refresh control to be shown was actually set on the view | |
// controller and the it is not already animating. Otherwise there's nothing | |
// to refresh. | |
guard let refreshControl = refreshControl, !refreshControl.isRefreshing else { | |
return |
// Author - Santosh Rajan | |
import Foundation | |
let string = "{\"name\": \"John\", \"age\": 35, \"children\": [\"Jack\", \"Jill\"]}" | |
func JSONParseDictionary(jsonString: String) -> [String: AnyObject] { | |
if let data = jsonString.dataUsingEncoding(NSUTF8StringEncoding) { | |
if let dictionary = NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions(0), error: nil) as? [String: AnyObject] { | |
return dictionary |
curl -v -X GET -H "range: bytes=1-8" http://localhost:8080/bbb/test
curl -v -X GET -H "range: bytes=10-" http://localhost:8080/bbb/test
<?xml version="1.0" encoding="UTF-8"?> | |
<phpunit | |
colors="true" | |
stopOnFailure="false" | |
backupGlobals="false" | |
backupStaticAttributes="false" | |
convertErrorsToExceptions="true" | |
convertNoticesToExceptions="true" | |
convertWarningsToExceptions="true" |
I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.
If you want to roll up all of these into a single jQuery plugin check out Sharrre
Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.
// Scraping Made Easy with jQuery and SelectorGadget | |
// (http://blog.dtrejo.com/scraping-made-easy-with-jquery-and-selectorga) | |
// by David Trejo | |
// | |
// Install node.js and npm: | |
// http://joyeur.com/2010/12/10/installing-node-and-npm/ | |
// Then run | |
// npm install jsdom jquery http-agent | |
// node numresults.js | |
// |