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
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")
File.open(path, "w") { |io| io << DATA.read }
browser = Selenium::WebDriver.for :firefox # replace :firefox with the browser you're having trouble with
begin
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
end
@jarib
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 git@github.com:ImperialCollegeLondon/covid19model.git
sudo apt-get update
sudo apt install docker.io 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
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
Vectors
-------
Algorithm: Gensim Continuous Skipgram
Corpus : Norsk Aviskorpus + NoWaC + NBDigital (lemmatized=False, case preserved=True, tokens=3028545953)
URL : http://vectors.nlpl.eu/repository/11/100.zip
This file has been truncated, but you can view the full file.
[
{
"path":"data/vectors-all/11-100",
"training":[
{
"meta":{
"lang":"nb",
"pipeline":[
"tagger",
"parser",
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",
"BP",
"Boeing",
"Booz Allen Hamilton",
"CACI International",
"Chevron",
"ConocoPhillips",
"DARPA",
#!/bin/bash
set -e
git clone https://github.com/edsu/anon 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 anon.coffee' > Procfile