Skip to content

Instantly share code, notes, and snippets.

View jarib's full-sized avatar

Jari Bakken jarib

View GitHub Profile
Started by timer
Building on master in workspace /mnt/jenkins/data/jobs/Mirror Selenium to GitHub/workspace
[workspace] $ /bin/sh -xe /tmp/hudson6358920160239539462.sh
+ cd selenium
+ git pull
Already up-to-date.
+ git push --mirror gh
To [email protected]:SeleniumHQ/selenium
- [deleted] jruby-174
* [new branch] gh/master -> gh/master
def edit_distance(a, b)
return 0 if !a || !b || a == b
return (a.length - b.length).abs if a.length == 0 || b.length == 0
m = [[0]]
1.upto(a.length) { |i| m[i] = [i] }
1.upto(b.length) { |j| m[0][j] = j }
1.upto(a.length) do |i|
1.upto(b.length) do |j|
m[i][j] =
[ m[i-1][j-1] + (a[i-1] == b[j-1] ? 0 : 1),
POST /session HTTP/1.1
Accept: application/json
Content-Type: application/json; charset=utf-8
Content-Length: 246
Accept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
User-Agent: Ruby
Connection: close
Host: 127.0.0.1:9515
{"desiredCapabilities":{"browserName":"chrome","version":"","platform":"ANY","javascriptEnabled":true,"cssSelectorsEnabled":true,"takesScreenshot":false,"nativeEvents":false,"rotatable":false,"chromeOptions":{"detach":true},"chrome.detach":true}}
require 'selenium-webdriver'
driver = Selenium::WebDriver.for :firefox
frame_html = <<-HTML
<a id="submit" href="#" onclick="window.top.location = 'http://www.google.no/'; return false;">Continue</a>
HTML
page = <<-HTML
@jarib
jarib / merge-flow.md
Last active February 23, 2017 05:05
# 1. add the contributor as a remote
$ git remote add <contributor-name> <contributor-url>

# 2. create a throw-away branch for the merge in case we mess up
$ git checkout -b test-merge

# 3. fetch the remote and reset to the branch they made the PR from
$ git fetch <contributor-name>
$ git reset --hard /
def vote_result_groups
{
:for => {...}
:against => {...}
:absent => {...}
}
end
---
@jarib
jarib / gist:5204817
Created March 20, 2013 13:54
My public key
ssh-dss AAAAB3NzaC1kc3MAAACBAJqLMUT8klGAt5VEIYAzsCNcG/8FsxBhFuCYSdvf9P5j7I84dOZsmGLHiqxcNEgrXkXMo4smJstYXSSdIVWF+RhSe4P7gH94D78mQS2dfGyXsWsJdqY7obEih76L0HCxhF8fcu4FBBCE3n1cQLfYTqAr6Crm3Rng3mTjUYQ/J8RFAAAAFQDqrN3s3nVO+2Fi6CnRw52IKpBMwQAAAIBTPpoQjYAKMMQuU0mJ/POmH4kzTeCLdyrv8v3pjJ8bOoyF6qMXqRVqlGgKmSEtmSlWD6fmnIyh34c5NiAGaJOySnkLUOLwjUvz2PkJpqazKRa1KkZblg69iKto7IpR2BID3b2gAorpJmNAtexlyn2vTrR3Ai3hCqAGy9rrnkrTEwAAAIAtwepHaG0mGPoYHzkoCNSu6Xzx3mdxFa10CxOj1BXtK5UsVysd5wWOqtYQNq4JZe9mSqk5+KRc1Q2aUAFHCgemMAP2C8RYaT+TiesFs5e+jEFG4HM6T0FDcOV6/+CVwM+IavYRC71ZkE1cM0o9Ycs79h5flNOS7unhSIlIM8OFsg== [email protected]
$ curl -i localhost:9200/
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Content-Length: 179
{
"ok" : true,
"status" : 200,
"name" : "Tarleton, George",
"version" : {
@jarib
jarib / SK19S4.txt
Created March 8, 2013 13:39
Stikkprøver sesjon 154
Tidspunkt : "00:26:00"
For : 8
Mot : 162
Ikke tilstede: 2
1 : F. de Ruiter A : M
2 : I. Godskesen FRP : M
3 : S. Harberg H : M
4 : K. I. Ropstad KRF : M
5 : T. S. Utsogn FRP : M
@jarib
jarib / a.md
Last active December 14, 2015 06:19
  1. Download git-fixws.rb to ~/bin/git-fixws.rb
  2. chmod +x ~/bin/git-fixws.rb
  3. git config --global alias.fixws '!ruby ~/bin/git-fixws.rb'

With a dirty tree, you can then run git fixws to have trailing whitespace removed.