This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Login to the usual dev FA account: https://fac.intNN.free.ag | |
create a new bank account | |
Create an Open Banking Modelo feed (choose any bank feed other than RBSG), Modelo login is mits / mits | |
Make sure to select at least one account and and complete setup to bank feed enablement. | |
Go into the int server console `devkit console int<NN>` | |
Find the bank feed you just created (`BankFeed.last` should find it) | |
Make sure you can mark it as connection issue, by calling the `connection_issue!` method on the bank feed object | |
Check that it's state has changed to `connection_issue` | |
Go back into the bank account in the FA app and check that the bank feed is no longer enabled. | |
It will display an 'enable feed' button but don't worry about this for now. Another PR will address this. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def stop! | |
raise hammertime | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def polymorphicable_path(polymorphicable, action: '') | |
url_for( | |
controller: polymorphicable.class.name.tableize, | |
action: action, | |
id: polymorphicable.id, | |
only_path: true | |
) | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module SpreeOdoo | |
class StockMovementPush | |
attr_reader :spree_variant, :stats, :gateway, :reference, :qty | |
def initialize(ooor, spree_variant, qty, reference, opts = {}) | |
@gateway = ooor | |
@stats = { total: 0, found: 0, adjusted: 0, errors: [] } | |
@spree_variant = spree_variant | |
@reference = reference | |
@qty = qty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
update spree_option_types set name = t1.name, presentation = t1.presentation from spree_option_type_translations as t1 where spree_option_types.id = t1.spree_option_type_id AND t1.locale = 'en'; | |
update spree_option_values set name = t1.name, presentation = t1.presentation from spree_option_value_translations as t1 where spree_option_values.id = t1.spree_option_value_id AND t1.locale = 'en'; | |
update spree_products set name = t1.name, description = t1.description, meta_description = t1.meta_description, meta_keywords = t1.meta_keywords, slug = t1.slug from spree_product_translations as t1 where spree_products.id = t1.spree_product_id and t1.locale = 'en'; | |
update spree_promotions set name = t1.name, description = t1.description from spree_promotion_translations as t1 where spree_promotions.id = t1.spree_promotion_id AND t1.locale = 'en'; | |
update spree_properties set name = t1.name, presentation = t1.presentation from spree_property_translations as t1 where spree_properties.id = t1.spree_property_id AND t1.lo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// IE11 version hack fix... | |
var ieversion = 0; | |
var ua = window.navigator.userAgent; | |
if (ua.indexOf('Trident/') != -1) { | |
ieversion = ua.substring(ua.indexOf('rv:') + 3); | |
ieversion = parseInt('' + ieversion, 10); | |
} | |
// in IE11 window.attachEvent was removed. | |
// if IE11 *or* window.attachEvent | |
if (window.attachEvent || ieversion >= 11) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this module adds rounding to the nearest decimal number. | |
# by default it rounds to the nearest 10 pence | |
# but you can also round to the nearest 50 / 1000 or whatever.. | |
# | |
module ExtendNumericRounding | |
def roundup( nearest=10 ) | |
self % nearest == 0 ? self : self + nearest - ( self % nearest ) | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create | |
@event.update_attribute(:status_id, params[:comment][:event_attributes][:status_id]) | |
params[:comment].delete(:event_attributes) # = nil # = {:id => params[:event_id]} | |
@comment = @event.comments.new(params[:comment]) | |
if @comment.save | |
redirect_to admin_event_comments_path(@event), :flash => { :info => "Comment created" } | |
else | |
render :action => :edit | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# the wrong way.. | |
class Payment < ActiveRecord::Base | |
belongs_to :booking | |
after_save :update_booking | |
def update_booking |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
bats=`ls /proc/acpi/battery/`; | |
for bat in $bats;do | |
remain=`cat /proc/acpi/battery/$bat/{info,state}|grep remaining|grep -o "[0-9]\+"` | |
full=`cat /proc/acpi/battery/$bat/{info,state}|grep full |grep -o "[0-9]\+"` | |
descap=`cat /proc/acpi/battery/$bat/{info,state}|grep "design capacity:" |grep -o "[0-9]\+"` | |
rate=`cat /proc/acpi/battery/$bat/{info,state}|grep "present rate:" |grep -o "[0-9]\+"` | |
state=`cat /proc/acpi/battery/$bat/{info,state}|grep "charging state:" |grep -o "[a-z]\+$"` | |
echo $state; | |
lostcap=$((((descap-full)*100)/descap)); |
NewerOlder