View gitlab_output.txt
Running with gitlab-ci-multi-runner 9.5.1 (96b34cc)
on ci_runner_02 (bcf9d6e9)
Using Docker executor with image ruby:2.4.3 ...
Starting service postgres:latest ...
Pulling docker image postgres:latest ...
Using docker image postgres:latest ID=sha256:ec61d13c85666651ff092b89d46ae958d81c7f3d387ed91ae5c530a38b9896e2 for postgres service...
Waiting for services to be up and running...
Using docker image sha256:b8b3cb280f3e2b76afb91d3c7c3227bac6de27e9f27e7ace2d9dd533b9c92309 for predefined container...
Pulling docker image ruby:2.4.3 ...
Using docker image ruby:2.4.3 ID=sha256:713da53688a6446953cb7c0260d03a65a115cb60b727a890142628a4622642c7 for build container...
View gitlab-ci.yml
image: ruby:2.4.3
stages:
- test
services:
- postgres:latest
variables:
POSTGRES_DB: sw-test-db
View tries.rb
class Trie
Node = Struct.new(:char, :children, :is_complete_word)
attr_reader :root
def initialize
@root = Node.new('', {}, false)
end
def add_word(word)
View download-url-to-file.rb
#!/usr/bin/env ruby
#
# Ruby script to download a number of files
# from individual URLs via HTTP/HTTPS/FTP
# specified in an external file.
#
# Author: Tobias Preuss
# Revision: 2013-04-18 16:26 +0100 UTC
# License: Creative Commons Attribution-ShareAlike 3.0 Unported
View Dockerfile
FROM ruby:2.2
RUN gem update --system && gem install bundler
RUN sed -i 's/deb http:\/\/httpredir.debian.org\/debian jessie main/deb http:\/\/httpredir.debian.org\/debian jessie main non-free/' /etc/apt/sources.list
RUN sed -i 's/deb http:\/\/security.debian.org jessie\/updates main/deb http:\/\/security.debian.org jessie\/updates main non-free/' /etc/apt/sources.list
RUN curl -sL https://deb.nodesource.com/setup_4.x | bash - && apt-get install -y nodejs unrar && npm install -g phantomjs
View application.js
//= require jquery
//= require jquery_ujs
$(function() {
var source = new EventSource('/stream');
source.addEventListener('counter', function(e) {
$('body').after(e.data + '<br />');
});
});
View counter.rb
require 'sinatra'
set server: :thin
get '/' do
erb :welcome
end
get '/stream', provides: 'text/event-stream' do
stream do |out|
loop do
View capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
View reverse_index.py
#! /usr/bin/python
# coding: utf-8
import codecs
import re
from string import punctuation
import collections
import sys
punctuation_regexp = re.compile(r'[\s{}]+'.format(re.escape(punctuation)))
View leakedin.go
// SHA Hash presence web server.
//
// Requires a file containing sorted sha1s in binary form (20 bytes each).
package main
import (
"encoding/hex"
"fmt"
"io/ioutil"