Skip to content

Instantly share code, notes, and snippets.

@tkensiski
tkensiski / reboot.sh
Last active August 29, 2015 14:21
Reboot andriod with Andriod SDK
# If you do not have homebrew installed
# use this command to install it, or go check it out at http://brew.sh/
# ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# You will also need to turn on USB Debugging in the Developer Options menu under Settings.
# If that menu does not exist go to the About Phone menu and click the Build Number 7 times
# and it should make it show up
# Otherwise follow the steps below:
brew install android-sdk
#!/usr/bin/env python
def generateRandomBinaryVector(p,n):
outcomes = np.zeros((n,1))
for index in range(0,n):
outcomes[index] = generateRandomCoinFlip(p)
return outcomes
@tkensiski
tkensiski / jserrorcollector.rb
Created March 20, 2014 02:27
Using JSErrorCollector w/ Ruby + Watir
require 'watir-webdriver'
profile = Selenium::WebDriver::Firefox::Profile.new
profile.add_extension File.join(Rails.root, "/JSErrorCollector.xpi")
browser = Watir::Browser.new :firefox, :profile => profile
browser.goto 'www.google.com'
errors = browser.execute_script("return window.JSErrorCollector_errors.pump()")