Skip to content

Instantly share code, notes, and snippets.

View thomasklemm's full-sized avatar

Thomas Klemm thomasklemm

View GitHub Profile
@thomasklemm
thomasklemm / chromedriver.rb
Last active January 7, 2019 11:18
Chromedriver settings for headless Chrome in RSpec/Rails, with switching between different drivers based on command line settings
# ChromeDriver for JavaScript enabled feature/system specs
#
# Example usage:
# `$ bin/rspec` # Chrome in Headless Mode (Default)
# `$ SHOW_BROWSER=true bin/rspec` # Chrome
# `$ SHOW_BROWSER=true DEVTOOLS=true bin/rspec` # Chrome with Devtools
require 'selenium/webdriver'
Capybara.register_driver :chrome do |app|
@thomasklemm
thomasklemm / clearance.de.yml
Created October 19, 2018 20:33
German translations for Clearance translations strings (Formal German)
de:
clearance:
models:
clearance_mailer:
change_password: Passwort zurücksetzen
clearance_mailer:
change_password:
closing: Bitte ignorieren Sie diese E-Mail, falls Sie kein neues
Passwort angefordert haben.
link_text: Ihr Passwort ändern
@thomasklemm
thomasklemm / stellar-core.cfg
Last active July 25, 2018 09:23
Stellar Core Config for Complete Catchup
HTTP_PORT=11626
PUBLIC_HTTP_PORT=true
LOG_FILE_PATH=""
DATABASE="postgresql://dbname=core host=localhost user=stellar password=__POSTGRES_PASSWORD__"
NETWORK_PASSPHRASE="Public Global Stellar Network ; September 2015"
CATCHUP_COMPLETE=true
MAX_CONCURRENT_SUBPROCESSES=32
AUTOMATIC_MAINTENANCE_PERIOD=0
@thomasklemm
thomasklemm / example_commands.txt
Last active October 13, 2018 20:16
Stellar Core config for complete catchup
# Upgrade a Linux instance after first boot
$ apt-get update
$ apt-get full-upgrade
$ apt-get autoremove
$ apt-get autoclean
$ reboot
$ docker run -it -v "/str:/opt/stellar" -p "5432:5432" -p "8000:8000" --name stellar stellar/quickstart --pubnet
# Edit stellar core config
@thomasklemm
thomasklemm / keybase.md
Created March 8, 2018 18:02
Keybase Proof

Keybase proof

I hereby claim:

  • I am thomasklemm on github.
  • I am thomasklemm (https://keybase.io/thomasklemm) on keybase.
  • I have a public key ASDAADdhGuTJg5yfViJvewxgrqycpgRHfLWbm8HvpQArBQo

To claim this, I am signing this object:

@thomasklemm
thomasklemm / cast_vote_planning.rb
Created April 2, 2016 00:21
Planning the vote casting for GoVote
# config/routes.rb
# "Cast a Vote"-Workflow
get 'vote', to: 'cast_votes#get_voter_token', as: :new_vote
post 'vote', to: 'cast_votes#verify_voter_token'
get 'cast_vote', to: 'cast_votes#get_choices', as: :cast_vote
post 'cast_vote', to: 'cast_votes#cast_vote'
get 'thank_you', to: 'cast_votes#thank_you', as: :thank_you
class CastVotesController < ApplicationController
@thomasklemm
thomasklemm / planning-go-vote.rb
Last active March 31, 2016 12:45
Planning the models and database structure for go.vote
Planning the database structure for go.vote
# Model structure
The main models are:
- Election
- Candidate
- Voter
- Vote
The models are associated as follows:
@thomasklemm
thomasklemm / user_spec_helper.rb
Created July 20, 2015 09:10
How to properly encapsulate and include helper methods in RSpec
module UserSpecHelper
def my_spec_helper_method(*args)
# ...
end
end
RSpec.configure do |config|
config.include UserSpecHelper
@thomasklemm
thomasklemm / task_list_feature_spec.rb
Created July 14, 2015 16:58
RSpec feature specs: Example feature and scenario structure for a list of records
require 'rails_helper'
feature 'task list' do
feature 'listing tasks' do
scenario 'opening the list with the default filters and sorting'
end
feature 'interacting with a task in the list' do
scenario 'adding a task'
@thomasklemm
thomasklemm / postgres_set_case.sql
Created June 9, 2015 16:18
Postgres SET using a CASE statement
UPDATE media_images
SET collectively_manage_publication_for_all_locales = (
CASE
WHEN ((published_de = published_en) AND (published_from_de = published_from_en))
THEN TRUE
ELSE FALSE
END
)