Skip to content

Instantly share code, notes, and snippets.

View Epigene's full-sized avatar

Augusts Bautra Epigene

View GitHub Profile
@Epigene
Epigene / multiline_ternary.rb
Created October 2, 2015 06:46
A glorious antipattern
# simple
def test(arg)
arg ?
"true" :
"false"
end
# nested
def test2(arg1, arg2)
arg1 ?
@Epigene
Epigene / Fallout4_Mod.md
Last active December 11, 2015 21:13
Fallout4 modding startup

Enable Custom content

1. Enable file selection

#../MyGames/Fallout4/Fallout4Prefs.ini

# under [Launcher]
bEnableFileSelection=1
@Epigene
Epigene / production.rb
Last active December 21, 2018 01:38
Dokku v0.4.x app production environment file
Rails.application.configure do
config.cache_classes = true
config.eager_load = true
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.serve_static_files = false
config.assets.js_compressor = :uglifier
config.assets.compile = false
@Epigene
Epigene / fish.conf
Created February 10, 2016 13:48
Fish2 configuration file
# Path to Oh My Fish install.
set -gx OMF_PATH /Users/augusts/.local/share/omf
source $OMF_PATH/init.fish
# Path to your oh-my-fish.
set PATH /Applications/Postgres.app/Contents/Versions/9.4/bin $PATH
set PATH ~/bin $PATH
set PATH /usr/local/bin $PATH
set -x RACK_ENV development
set -x EDITOR atom
@Epigene
Epigene / known_nord_master_failures.txt
Created March 16, 2016 12:07
Test failures on master, before rails update an Transaction -> Payment change
Finished in -23759279.72749 seconds (files took 5.46 seconds to load)
590 examples, 65 failures, 39 pending
Failed examples:
rspec ./spec/models/order_spec.rb:26 # Order Spec should get a user with phone number by default
rspec ./spec/models/order_spec.rb:341 # Order current_pipeline_payment_system order without pipline returns nil
rspec ./spec/models/order_spec.rb:356 # Order paid order has one paid order
rspec ./spec/models/order_spec.rb:195 # Order statuses #paid? should return true if status is paid
rspec ./spec/models/order_spec.rb:218 # Order statuses ecommercable? method should return true if order paid but transaction provider is swedbank_lv
@Epigene
Epigene / inadequate_request_dump.txt
Created March 21, 2016 07:51
Dump of a request object where browser gem's `browser.to_s` fails with undefined method `[]' for nil:NilClass
This file has been truncated, but you can view the full file.
:mobile_device? encountered an error:
undefined method `[]' for nil:NilClass
Request:
#<ActionDispatch::Request:0xf2ba0c0 @env={"REMOTE_ADDR"=>"127.0.0.1", "REQUEST_METHOD"=>"GET", "REQUEST_PATH"=>"/lv/lv/p/m1/intro", "PATH_INFO"=>"/lv/lv/p/m1/intro", "REQUEST_URI"=>"/lv/lv/p/m1/intro", "SERVER_PROTOCOL"=>"HTTP/1.0", "HTTP_VERSION"=>"HTTP/1.0", "HTTP_X_REAL_IP"=>"104.155.83.235", "HTTP_X_FORWARDED_FOR"=>"104.155.83.235", "HTTP_X_FORWARDED_PROTO"=>"https", "HTTP_HOST"=>"v1.stockholmhealth.com", "HTTP_CONNECTION"=>"close", "rack.url_scheme"=>"https", "SERVER_NAME"=>"v1.stockholmhealth.com", "SERVER_PORT"=>"443", "QUERY_STRING"=>"", "rack.input"=>#<StringIO:0x9678ca8>, "rack.hijack"=>#<Proc:0xf270538@/home/deployer/apps/nordenhealth/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_request.rb:111>, "rack.errors"=>#<File:/home/deployer/apps/nordenhealth/current/log/unicorn.log>, "rack.multiprocess"=>true, "rack.multithread"=>false, "rack.run_once"=>false, "rack.version"=>[1, 2], "SCRIPT_NAME"=>"", "SER
@Epigene
Epigene / truncated_request_dump.txt
Created March 21, 2016 07:55
Request dump where browser's browser.to_s fails with undefined method `[]' for nil:NilClass
:mobile_device? encountered an error:
undefined method `[]' for nil:NilClass
Request:
#<ActionDispatch::Request:0xf2ba0c0 @env={"REMOTE_ADDR"=>"127.0.0.1", "REQUEST_METHOD"=>"GET", "REQUEST_PATH"=>"/lv/lv/p/m1/intro", "PATH_INFO"=>"/lv/lv/p/m1/intro", "REQUEST_URI"=>"/lv/lv/p/m1/intro", "SERVER_PROTOCOL"=>"HTTP/1.0", "HTTP_VERSION"=>"HTTP/1.0", "HTTP_X_REAL_IP"=>"104.155.83.235", "HTTP_X_FORWARDED_FOR"=>"104.155.83.235", "HTTP_X_FORWARDED_PROTO"=>"https", "HTTP_HOST"=>"v1.stockholmhealth.com", "HTTP_CONNECTION"=>"close", "rack.url_scheme"=>"https", "SERVER_NAME"=>"v1.stockholmhealth.com", "SERVER_PORT"=>"443", "QUERY_STRING"=>"", "rack.input"=>#<StringIO:0x9678ca8>, "rack.hijack"=>#<Proc:0xf270538@/home/deployer/apps/nordenhealth/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_request.rb:111>, "rack.errors"=>#<File:/home/deployer/apps/nordenhealth/current/log/unicorn.log>, "rack.multiprocess"=>true, "rack.multithread"=>false, "rack.run_once"=>false, "rack.version"=>[1, 2], "SCRIPT_NAME"=>"", "SER
@Epigene
Epigene / staging.rb
Created March 22, 2016 10:33
Dokku v0.4.x app staging environment file
Rails.application.configure do
config.action_controller.asset_host = "https://staging.yourdomain.com/"
config.cache_classes = true
config.eager_load = true
config.consider_all_requests_local = true
config.action_controller.perform_caching = true
config.serve_static_files = false
config.assets.js_compressor = :uglifier
@Epigene
Epigene / paypal_setup.md
Last active April 5, 2016 07:19
Workflow for setting up a new PayPal account to receive payments

PayPal Setup

1. Configure the managing account

Create an account with PayPal
Follow through all the steps to enable recieving payments
Visit the config page to review your progress

2. (Optional) Get the sandbox API app information

Log into PayPal developer site (create a session)
Navigate to sandbox acounts