Skip to content

Instantly share code, notes, and snippets.

View DylanLacey's full-sized avatar

The Gentlehacker DylanLacey

View GitHub Profile
@DylanLacey
DylanLacey / Gemfile
Created March 25, 2015 00:45
Extended Selenium HTTP timeout
# Add net-http-persistent to your Gemfile; `bundle install` then alter your WebDriver setup as shown below.
gem 'net-http-persistent'
@DylanLacey
DylanLacey / AttachableWebDriver.java
Created March 3, 2015 08:13
Attach WebDrivers to existing Sessions
package com.saucelabs;
import java.util.Map;
import java.net.URL;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.DriverCommand;
import org.openqa.selenium.remote.HttpCommandExecutor;
@DylanLacey
DylanLacey / fetch_photos.sh
Last active May 19, 2016 08:32
DoThePhotoThing
#!/bin/bash
#! /bin/bash
# Wait until the simulator is running before we try to add the file
simulator=$(ps aux | grep launchd_sim | grep -v grep)
while [ -z "$simulator" ]
do
echo Sleeping for 5
sleep 5
@DylanLacey
DylanLacey / server.rb
Created January 23, 2015 06:18
Simple server which sleeps for 75 seconds
require "webrick"
server = WEBrick::HTTPServer.new :Port => 9000
server.mount_proc '/' do |req, res|
calling_time = Time.now
sleep 75
response_time = Time.now
res.body = "Hello, world! You asked for me at #{calling_time} but I ignored you until #{response_time}"
end
@DylanLacey
DylanLacey / prerun.bat
Last active August 29, 2015 14:12
Host File Prerun
echo 127.0.0.0 pagead2.googlesyndication.com >> %WINDIR%\System32\Drivers\Etc\Hosts
echo 127.0.0.0 googleads.g.doubleclick.net >> %WINDIR%\System32\Drivers\Etc\Hosts
@DylanLacey
DylanLacey / start.bat
Created November 7, 2014 06:57
Windows Task Manager
taskmgr
@DylanLacey
DylanLacey / prerun.sh
Last active August 29, 2015 14:08
BeMoreInternational
#! /bin/bash
/usr/libexec/PlistBuddy -c "Add :AppleKeyboards:0 string zh_Hans-HWR@sw=HWR" ~/Library/Application\ Support/iPhone\ Simulator/7.1-64/Library/Preferences/.GlobalPreferences.plist
@DylanLacey
DylanLacey / natch.bat
Created October 29, 2014 01:47
Peter Repeater
:loop
arp -s 192.168.1.254 xx-xx-xx-xx-xx-xx
ipconfig /flushdns
ping localhost -n 11 > nul
print "I'm outputting"
goto loop
#!/bin/bash
mkdir ~/.fonts
cd ~/.fonts
wget http://unifoundry.com/pub/unifont-7.0.03/font-builds/unifont-7.0.03.ttf
@DylanLacey
DylanLacey / make_exist.sh
Last active August 29, 2015 14:06
touch_the_logs
#!/bin/bash -e
mkdir /Users/chef/Library/Logs/iOS\ Simulator
chmod a+rwx /Users/chef/Library/Logs/iOS\ Simulator
mkdir /Users/chef/Library/Logs/iOS\ Simulator/7.1-64
chmod a+rwx /Users/chef/Library/Logs/iOS\ Simulator/7.1-64
ls /Users/chef/Library/Logs/iOS\ Simulator/