Skip to content

Instantly share code, notes, and snippets.

@gempesaw
gempesaw / transpiled.js
Created May 12, 2015 14:39
newest traceur & ng-annotate compatibility
// version 0.0.88 & 0.0.89
(function () {
var MyController = (function() {
function MyController(args) {}
return ($traceurRuntime.createClass)(MyController, {}, {});
}());
angular.module('test').controller('MyController', MyController);
return {};
});
ruby watir.rb
We must explicitly catch this failed find_element
Or else it will kill the script
/Users/dgempesaw/.rvm/gems/ruby-2.2.0/gems/watir-webdriver-0.6.11/lib/watir-webdriver/elements/element.rb:513:in `assert_exists': unable to locate element, using {:name=>"missing", :tag_name=>"input or textarea", :type=>"(any text type)"} (Watir::Exception::UnknownObjectException)
from /Users/dgempesaw/.rvm/gems/ruby-2.2.0/gems/watir-webdriver-0.6.11/lib/watir-webdriver/user_editable.rb:11:in `set'
from watir.rb:12:in `<main>'
@gempesaw
gempesaw / test.pl
Last active August 29, 2015 14:13
exceptions
#! /usr/bin/perl
use strict;
use warnings;
use feature qw/say/;
use Selenium::Remote::Driver;
my $d = Selenium::Remote::Driver->new;
$d->get('http://www.google.com');
@gempesaw
gempesaw / Waiter.pm
Created October 18, 2014 22:32
spin assert class
package Honeydew::Common::Waiter;
$Honeydew::Common::Waiter::VERSION = '0.19';
# ABSTRACT: A Waiter class to spin assert your NON-BLOCKING time-dependent operations
use strict;
use warnings;
use Moo;
use Carp;
has 'assert' => (
@gempesaw
gempesaw / res.json
Created June 30, 2014 19:32
GET /session/{sessionId}/element/{id} from 2.41.0
{
"class": "org.openqa.selenium.remote.Response",
"hCode": 1307096689,
"sessionId": "3bd3063c-a5f7-4360-9e00-25cd9ffa36b7",
"state": null,
"status": 0,
"value": {
"class": "com.sun.proxy.$Proxy4",
"displayed": true,
"enabled": true,
# installs to /opt/gradle
# existing versions are not overwritten/deleted
# seamless upgrades/downgrades
# $GRADLE_HOME points to latest *installed* (not released)
gradle_version=1.11
wget -N http://services.gradle.org/distributions/gradle-${gradle_version}-all.zip
unzip -foq gradle-${gradle_version}-all.zip -d /home/dev/opt/gradle
ln -sfn gradle-${gradle_version} /home/dev/opt/gradle/latest
printf "export GRADLE_HOME=/home/dev/opt/gradle/latest\nexport PATH=\$PATH:\$GRADLE_HOME/bin" > /home/dev/gradle.sh
. /home/dev/gradle.sh
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.
@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>
@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 / 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)