Skip to content

Instantly share code, notes, and snippets.

@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 {
(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 / 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)
@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 / 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 / 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 / subtitle-shifter.el
Last active December 27, 2015 01:28
Convenience functions for shifting between milliseconds and 00:00:00,000 format along with an interactive function to rewrite each of the timers in a .srt file. Invoking `convert-next-time` will run through the whole file and try to avoid getting stopped by `max-specpdl-size`. That's probably bad, for bigger .srt files...
(defvar time-multipliers `(,(* 60 60 1000) ,(* 60 1000) 1000 1)
"Multipliers for going to and from milliseconds and
00:00:00,000 format")
(defvar subtitle-offset "00:00:04,764"
"Amount in 00:00:00,000 format of offset to shift the values
by ")
(ert-deftest subtitle-shift-tests ()
(let ((max-lisp-eval-depth 1500)
@gempesaw
gempesaw / SauceConnectConvenience.md
Last active January 2, 2019 08:57
convenience shell scripts for sauce connect
Usage: ./sauce COMMAND
Control your sauce tunnel.

The commands you can use are:

   help         Show this help

   restart      Kill all java processes belonging to the user and
 nohup the sauce tunnel, stdout redirected to
@gempesaw
gempesaw / right command to f17.xml
Last active December 31, 2015 06:09
os x right option to f17
<?xml version="1.0"?>
<root>
<item>
<name>Change right option key to F17</name>
<identifier>private.right_option_to_f17</identifier>
<autogen>__KeyToKey__ KeyCode::RawValue::0x6e, KeyCode::F17</autogen>
</item>
<item>
<name>Shifts to Parentheses</name>
<appendix>Shifts, when pressed alone, type parentheses. When used with other keys they're normal shifts.</appendix>
cpanm (App::cpanminus) 1.7001 on perl 5.018000 built for x86_64-linux
Work directory is /home/travis/.cpanm/work/1397927768.15814
You have make /usr/bin/make
You have LWP 6.05
You have /bin/tar: tar (GNU tar) 1.26
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.