Skip to content

Instantly share code, notes, and snippets.

View mehmetg's full-sized avatar

Mehmet mehmetg

  • San Francisco, CA
View GitHub Profile
Changes/Fixes: (mehmetg/ablog branch: devel)
1. extlinks = { 'wiki': ('http://en.wikipedia.org/wiki/%s', '') } ??? what should be %s. Should we ask the user if (s)he has a
wiki for the blog or whatever project or generic external links questions?
2. html_theme_options for alabaster users: logo? where should it be placed or can it include an path with the name? should we check path icon if it exists or not??? If it does not exist it won't show (no errors will display)
3. Added google analytics id prompt. should we keep it?
@mehmetg
mehmetg / SeleniumBrowserLogHelper.java
Last active December 9, 2015 21:45
Helper class for setting selenium browser logging capabilities.
package com.yourcompany.Utils;
import org.openqa.selenium.logging.LogType;
import org.openqa.selenium.logging.LoggingPreferences;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.ie.InternetExplorerDriverLogLevel;
/**
* Created by mehmetgerceker on 12/10/15.
*/
import com.saucelabs.saucerest.SauceREST;
import java.io.File;
import java.nio.file.Paths;
/* The code below is a snippet. It won't run or compile unless integrated in the appropriate class
** This is only supported on recent versions Firefox and Chrome when used with recent versions of
** Firefox and Chrome driver.
*/
import org.openqa.selenium.logging.LogEntries;
import org.openqa.selenium.logging.LogEntry;
import org.openqa.selenium.logging.LogType;
import org.openqa.selenium.logging.LoggingPreferences;
import org.openqa.selenium.remote.CapabilityType;
@mehmetg
mehmetg / enroll_touch_id.sh
Last active February 24, 2016 03:10
Enable iOS Sim option to Enroll Touch Id
#!/bin/bash
export script=$'tell application "System Events" to tell process "Simulator"\nclick menu item "Touch ID Enrolled" of menu 1 of menu bar item "Hardware" of menu bar 1\nend tell'
osascript -e "$script"
@mehmetg
mehmetg / start_sc.sh
Last active October 25, 2016 13:44
Starts 5 SC instances for round robin load balancing and 1 for command relay. Relies on https://gist.github.com/mehmetg/9cdc77269ddef72ebc84
#!/usr/bin/env bash
#This script is intended to be run from the root of the sauce connect package.
SCBIN="bin/sc"
uname=$1
akey=$2
uname="user name"
akey="access key"
LOGPREFIX="/tmp"
@mehmetg
mehmetg / stop_sc.sh
Created March 26, 2016 05:20
Stops SC and relies on the pid files created by https://gist.github.com/mehmetg/20c2a0f9df25424e130a
#!/usr/bin/env bash
cat /tmp/sc*.pid
pids=$(cat /tmp/sc*.pid)
if ! [[ -z $pids ]]; then
echo $pids | xargs kill
fi
ctr=0
while ! [[ -z $(ls /tmp/sc*.pid |grep pid) ]] && [[ ctr -lt 100 ]];
do
@mehmetg
mehmetg / limit_bw.sh
Last active March 26, 2016 06:56
takes bw limit as argument e.g. 1250kbps
tc qdisc del dev eth0 root
tc qdisc add dev eth0 handle 1: root htb default 11
tc class add dev eth0 parent 1: classid 1:1 htb rate $1
tc class add dev eth0 parent 1:1 classid 1:11 htb rate $1
tc qdisc del dev eth0 root
@mehmetg
mehmetg / conf.js
Created May 5, 2016 17:49
Protractor config with Sauce Labs build id and test name updates.
// https://github.com/angular/protractor/blob/master/docs/referenceConf.js
var q = require('q');
var jasmineReporters = require('jasmine-reporters');
exports.config = {
sauceUser: process.env.SAUCE_USERNAME,
sauceKey: process.env.SAUCE_ACCESS_KEY,
//seleniumAddress: 'http://ondemand.saucelabs.com:80/wd/hub',
specs: ['specs/*spec.js'],