Skip to content

Instantly share code, notes, and snippets.

@gempesaw
gempesaw / webdriverAddCookie.pl
Created February 26, 2013 16:41
webdriver set a cookie
#! /usr/bin/perl
use strict;
use warnings;
use Selenium::Remote::Driver;
my $driver = new Selenium::Remote::Driver();
$driver->get("http://www.google.com");
@gempesaw
gempesaw / patch-two-files-alongside.el
Last active December 13, 2015 22:49
patch-two-files-alongside
;; https://plus.google.com/u/0/105641731374531810537/posts/YDz3n6BWmea
(defun my-stitch-two-files-alongside (left-file right-file)
"Patch two files together side by side"
(interactive "fRequest file: \nfResponse file: ")
(pop-to-buffer (generate-new-buffer "merged-req-rsp-files"))
(let ((left-strings (file-string-list left-file))
(right-strings (file-string-list right-file)))
(while left-strings
(insert (car left-strings) " -> " (car right-strings))
@gempesaw
gempesaw / reset-ssh-connections.el
Last active December 13, 2015 17:09
reset-ssh-connections
(require 'dash)
(defun reset-ssh-connections ()
(interactive)
(let ((tramp-buffers
(-filter (lambda (item)
(string-match "tramp" (buffer-name item)))
(buffer-list))))
(while tramp-buffers
(kill-buffer (car tramp-buffers))
@gempesaw
gempesaw / vertical-ido.el
Last active December 12, 2015 12:09
ido-vertical-results
;; Display ido results vertically, rather than horizontally
(setq ido-decorations '("\n-> " "" "\n " "\n ..."
"[" "]" " [No match]" " [Matched]"
" [Not readable]" " [Too big]" " [Confirm]"))
(defun ido-disable-line-trucation ()
(set (make-local-variable 'truncate-lines) nil))
(add-hook 'ido-minibuffer-setup-hook 'ido-disable-line-trucation)
(setq ssh-config-path "~/.ssh/config")
(defun get-file-as-string (filePath)
"Return FILEPATH's file content."
(with-temp-buffer
(insert-file-contents filePath)
(split-string
(buffer-string) "\n" t)))
(defun get-remote-names ()
@gempesaw
gempesaw / TestingSe2Sauce.java
Created July 3, 2012 20:05
can't create cookies in IE with Se 2.24.1 ?
import junit.framework.TestCase;
import org.openqa.selenium.*;
import org.openqa.selenium.remote.*;
import java.net.URL;
import java.util.concurrent.TimeUnit;
public class TestingSe2Sauce extends TestCase {
private WebDriver driver;
public void setUp() throws Exception {