Skip to content

Instantly share code, notes, and snippets.

View jarib's full-sized avatar

Jari Bakken jarib

View GitHub Profile

Selenium RC and WebDriver

This gem replaces the now unmaintained selenium-client gem for RC users. The RC client and WebDriver clients live in separate namespaces:

  • Selenium::Client bindings for Selenium RC (imported from the selenium-client gem)
  • Selenium::WebDriver bindings for WebDriver

The selenium-client code is mostly unchanged, with a few exceptions:

jarib / file.rb
Created June 14, 2011 13:02
selenium-webdriver bug report template
require 'rubygems'
require 'selenium-webdriver'
path = File.expand_path("test.html"), "w") { |io| io << }
browser = Selenium::WebDriver.for :firefox # replace :firefox with the browser you're having trouble with
browser.get "file://#{path}"
require 'rubygems'
require 'watir-webdriver' # gem install watir-webdriver
require 'rspec' # gem install rspec
class BrowserContainer
attr_reader :browser
def initialize(browser)
@browser = browser
jarib / file.rb
Created January 19, 2010 11:13
FFI wrapper for CreateProcess()
require "rubygems"
require "ffi"
module WinProcess
extend FFI::Library
ffi_lib "kernel32"
ffi_convention :stdcall
class Error < StandardError
git clone
sudo apt-get update
sudo apt install emacs25-nox
sudo usermod -aG docker $USER
docker build -f docker/Dockerfile -t covid19model:latest .
docker run --rm --user $(id -u):$(id -g) -v $(pwd):/var/model -e FULL=TRUE covid19model:latest
jarib / spacy-nlpl-report.txt
Last active December 28, 2018 15:26
Evaluating NLPL vectors for Spacy
Model 0
Path: data/vectors-all/11-100
Algorithm: Gensim Continuous Skipgram
Corpus : Norsk Aviskorpus + NoWaC + NBDigital (lemmatized=False, case preserved=True, tokens=3028545953)
This file has been truncated, but you can view the full file.
import spacy
nlp = spacy.load('data/models/model7')
for idx, sent in enumerate(nlp('Hva heter du? Jeg heter Jonas.').sents):
print (idx, sent)
# Output:
# 0 Hva heter du? Jeg heter Jonas.
"Anadarko Petroleum",
"BAE Systems",
"Booz Allen Hamilton",
"CACI International",
set -e
git clone my-anon
cd my-anon
cp config.json.template config.json
read -p "Please add your config to $(pwd)/config.json, then press enter to continue"
heroku create
echo 'web: coffee' > Procfile