Skip to content

Instantly share code, notes, and snippets.

View ddavison's full-sized avatar
🌐
Working Remotely

Dj ddavison

🌐
Working Remotely
View GitHub Profile
Main Module
Get input from user
Display unit price (price per ounce)
Display total price
End Main Module
Get Input Module
Declare ItemName as String
Declare UnitPrice as Float
Declare Pounds as Float
/**
Main File
**/
#include "Card.h"
#include <vector>
using namespace Cards;
void shuffle(std::vector<Card> deck) {
for (int suit = 0; suit < 3; suit++) {
@ddavison
ddavison / JavaPackages.java
Created May 9, 2014 21:36
JavaPackages - using the [getting-started-with-selenium](http://github.com/ddavison/getting-started-with-selenium) framework
package com.company.seleniumframework.functional;
import com.company.seleniumframework.AutomationTest;
import com.company.seleniumframework.Browser;
import com.company.seleniumframework.Config;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import java.util.ArrayList;
@ddavison
ddavison / pkgs.json
Created May 9, 2014 21:39
Java 8 API Packages / Subpackages
[
java,
applet,
awt,
color,
datatransfer,
dnd,
event,
font,
geom,
casper.test.begin 'assertDoesntExist() tests', 1, (test) ->
casper.start().then ->
@setContent '<div class="heaven"></div>'
test.assertDoesntExist '.taxes'
.run ->
test.done()
BATTLING: Bandit
`'#'
';::::;
+:::::;:`
;;::::;::+
`':::::::;::,
+:::::;:::;+
'::::::;+;;+++:
#::+, ;;';::::'+##+'##
;::::#+++''''+#+#'';;;''#
@ddavison
ddavison / unlock.sh
Created September 12, 2014 18:48
Ubunut: Unlock (port forward) port 80 to another port
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
@ddavison
ddavison / closeWindow.java
Last active August 29, 2015 14:06
waitForWindow() switchToWindow() closeWindow()
/**
* Close an open window.
* <br>
* If you have opened only 1 external window, then when you call this method, the context will switch back to the window you were using before.<br>
* <br>
* If you had more than 2 windows displaying, then you will need to call {@link #switchToWindow(String)} to switch back context.
* @param regex The title of the window to close (regex enabled). You may specify <code>null</code> to close the active window. If you specify <code>null</code> then the context will switch back to the initial window.
* @return
*/
public AutomationTest closeWindow(String regex) {
@ddavison
ddavison / doit.sh
Created September 22, 2014 18:40
Find a process using a port on a mac
$ lsof -n -i4TCP:3000 | grep LISTEN
$ # where 3000 is the port number
@ddavison
ddavison / download_chromedriver.sh
Last active August 29, 2015 14:07
Download Mac Chromedriver
#!/bin/sh
####
# Author: ddavison
# Description: Download the Mac chromedriver into the current directory
####
function downloadchrome {
latest=`curl http://chromedriver.storage.googleapis.com/LATEST_RELEASE`
download_location="http://chromedriver.storage.googleapis.com/$latest/chromedriver_mac32.zip"
wget -P /tmp $download_location
unzip /tmp/chromedriver_mac32.zip -d .