Skip to content

Instantly share code, notes, and snippets.

View thomasklemm's full-sized avatar

Thomas Klemm thomasklemm

View GitHub Profile
@thomasklemm
thomasklemm / devise.de.yml
Created October 4, 2013 06:14
Devise 3.1.0 i18n German
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
de:
devise:
confirmations:
confirmed: "Vielen Dank für Deine Registrierung. Bitte melde dich jetzt an."
confirmed_and_signed_in: "Vielen Dank für Deine Registrierung. Du bist jetzt angemeldet."
send_instructions: "Du erhältst in wenigen Minuten eine E-Mail, mit der Du Deine Registrierung bestätigen kannst."
send_paranoid_instructions: "Falls Deine E-Mail-Adresse in unserer Datenbank existiert erhältst Du in wenigen Minuten eine E-Mail mit der Du Deine Registrierung bestätigen kannst."
failure:
@thomasklemm
thomasklemm / icon_helper.rb
Created August 26, 2014 19:38
Icon Helper for Font Awesome in Ruby on Rails
module IconHelper
ICON_MAPPINGS = {
# Generic actions
:save => 'fa-check',
:cancel => 'fa-times',
:back => 'fa-arrow-left',
# Record actions
:new => 'fa-plus',
@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 / 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 / active_record_sqlite_in_memory_db.rb
Created April 27, 2015 21:01
Awesome ActiveRecord bug report script. How to use ActiveRecord and SQLite in a Ruby script.
# Based on http://www.jonathanleighton.com/articles/2011/awesome-active-record-bug-reports/
# Run this script with `$ ruby my_script.rb`
require 'sqlite3'
require 'active_record'
# Use `binding.pry` anywhere in this script for easy debugging
require 'pry'
# Connect to an in-memory sqlite3 database
@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 / 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 / sma9.rb
Created October 30, 2012 11:03
Calculation of Simple Moving Average 9
# Require the json library to parse json into Ruby objects
require 'json'
require 'simple_statistics'
# The input
json = '[
{
"Low": 8.63,
"Volume": 14211900,
"Date": "2012-10-26",
@thomasklemm
thomasklemm / simplifying_has_many_through.rb
Last active May 15, 2016 22:12
Simplifying a has_many :through (ActiveRecord / Rails). Also a useful boilerplate sharing complex ActiveRecord scenarios.
# Run this script with `$ ruby has_much_fun.rb`
require 'sqlite3'
require 'active_record'
# Use `binding.pry` anywhere in this script for easy debugging
require 'pry'
# Connect to an in-memory sqlite3 database
ActiveRecord::Base.establish_connection(
adapter: 'sqlite3',